home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / atari / c / ck5a189b / ckuker.doc < prev    next >
Text File  |  1993-08-20  |  251KB  |  5,881 lines

  1.  
  2.                               C-KERMIT USER GUIDE
  3.  
  4.  
  5.               FOR UNIX, VAX/VMS, AND SOME OTHER OPERATING SYSTEMS
  6.  
  7.  
  8.  
  9.                              Version 5A(180) BETA
  10.  
  11.  
  12.  
  13.  
  14.  
  15.                     Christine M. Gianone and Frank da Cruz
  16.  
  17.               Columbia University Center for Computing Activities
  18.                              612 West 115th Street
  19.                             New York, NY 10025 USA
  20.  
  21.  
  22.  
  23.  
  24.  
  25.                                    D*R*A*F*T
  26.  
  27.                                   26 May 1992
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.                            Copyright (C) 1985, 1992
  38.             Trustees of Columbia University in the City of New York
  39.  
  40.       Permission is granted to any individual or institution to use this
  41.  software as long as it is not sold for profit.  This copyright notice must be
  42.   retained.  This software may not be included in commercial products without
  43.                   written permission of Columbia University.
  44. 1. C-Kermit
  45.  
  46. ********
  47. This document is formatted as an ordinary, plain text ASCII disk file.  Typeset
  48. copies are available from Columbia University.  Changes should be made to
  49. CKUKER.MSS.
  50. ********
  51.  
  52. Program:        Frank da Cruz (Columbia University), contributions by many
  53.                 others.
  54. Language:       C
  55. Documentation:  Christine Gianone, Frank da Cruz (Columbia University).
  56. Version:        5A(180) BETA
  57. Date:           May 26, 1992
  58.  
  59.  
  60. C-Kermit Capabilities At A Glance:
  61.  
  62.   Local operation:                   Yes
  63.   Remote operation:                  Yes
  64.   Transfer text files:               Yes
  65.   Transfer binary files:             Yes
  66.   International text:                Yes
  67.   Wildcard send:                     Yes
  68.   File transfer interruption:        Yes
  69.   Filename collision actions:        Yes
  70.   Can time out:                      Yes
  71.   8th-bit prefixing:                 Yes
  72.   Repeat count prefixing:            Yes
  73.   Alternate block checks:            Yes
  74.   Automatic parity detection:        Yes
  75.   Dynamic packet length:             Yes
  76.   CONNECT mode:                      Yes
  77.   Terminal emulation:                Depends on implementation
  78.   Key mapping:                       Yes
  79.   Communication settings:            Yes
  80.   Transmit BREAK:                    Yes (most versions)
  81.   Support for dialout modems:        Yes
  82.   TCP/IP support:                    Yes (some versions, Berkeley sockets)
  83.   X.25 support:                      Yes (SUN versions with SunLink)
  84.   IBM mainframe communication:       Yes
  85.   Transaction logging:               Yes
  86.   Session logging:                   Yes
  87.   Debug logging:                     Yes
  88.   Packet logging:                    Yes
  89.   Act as server:                     Yes
  90.   Talk to server:                    Yes
  91.   Advanced server functions:         Yes
  92.   Security for server:               Yes
  93.   Local file management:             Yes
  94.   Command/Init files:                Yes
  95.   Long packets:                      Yes
  96.   Sliding Windows:                   Yes
  97.   File attributes packets:           Yes
  98.   Command macros:                    Yes
  99.   Script programming language:       Yes
  100.   Raw file transmit and capture:     Yes
  101.  
  102.     -----------------------------------------------------------------------
  103.     IMPORTANT NOTICE: The user manual for the current release of C-Kermit
  104.     is "Using C-Kermit", by Frank da Cruz and Christine M. Gianone, published
  105.     by Digital Press, Burlington, MA.  Publication date: Fall 1992.  After
  106.     Fall 1992, call Digital Press at 1-800-344-4825 for further
  107.     information.
  108.     -----------------------------------------------------------------------
  109.  
  110. 1.1. Acknowledgements
  111.  
  112. Thanks to the dozens of people who have been involved in C-Kermit development
  113. over the years, especially Bill Catchings, Jeff Damens and Chris Maio (formerly
  114. of Columbia University), and Herm Fischer of Encino, CA, for their roles in its
  115. initial development.  And special thanks to those who put so much work into
  116. features or testing of version 5A:
  117.  
  118.     Kristoffer Eriksson (Peridot Konsult AB, Orebro, Sweden)
  119.     Bo Kullmar (Sveriges Riksbank (Central Bank of Sweden), Stockholm)
  120.     Tor Lillqvist (Helsinki University, Finland)
  121.     Warren H. Tucker (Tridom Corporation, Mountain Park, Georgia, USA)
  122.     Peter Mauzey (AT&T Bell Laboratories, Middletown, New Jersey, USA)
  123.     Terry Kennedy (St Peters College, Jersey City, NJ, USA)
  124.     Chuck Hedrick (Rutgers University, New Brunswick, NJ, USA)
  125.     Joe R. Doupnik (Utah State University, USA)
  126.     Hirofumi Fujii (Japan National Lab for High Energy Physics, Tokyo)
  127.     Ken Yap (University of Rochester, New York, USA)
  128.     Marcello Frutig (Catholic University, Rio de Janeiro, Brazil)
  129.     Paul Placeway (BBN, Cambridge, Massachusetts, USA)
  130.     Mark Buda (Digital Equipment Corporation, New Hampshire, USA)
  131.     William Bader (Software Consulting Services, Nazareth, PA, USA)
  132.     Steve Walton (California State University Northridge, USA)
  133.     Rick Watson (University of Texas at Austin, USA)
  134.     Peter Svanberg (Royal Techn. HS, Sweden)
  135.     Michel Robitaille (University of Montreal, Canada)
  136.     Kai Uwe Rommel (Technische Universitat Muenchen, Germany)
  137.     Paul Kline (Drake University, USA)
  138.     Chris Adie (Edinburgh University, Scotland, UK)
  139.     Chris Armstrong (Brookhaven National Laboratory, New York, USA)
  140.     James Harvey (Indiana/Purdue University, USA)
  141.     Bob Larson (University of Southern California, USA)
  142.     Christian Hemsing (RWTH Aachen, Germany)
  143.     Bruce J. Moore (Allen-Bradley Co, Highland Heights, OH)
  144.  
  145. Kristoffer, Bo, Warren, and Peter comprised the "modem committee", which worked
  146. long and hard to rationalize C-Kermit's treatment of modem signals in the many
  147. and varied UNIX environments.  Kristoffer and Bo also contributed much code to
  148. the UNIX-specific support modules.  Kristoffer deserves a special Archaeology
  149. Achievement Award for a detailed study and unraveling of many years' accretions
  150. of incomprehensible "magic" in the infamous ckutio.c module (a collection of
  151. supposedly simple functions that give the emphatic lie to all claims that UNIX
  152. is a "portable operating system").
  153.  
  154. Ken got the TCP/IP support started by supplying the socket-opening code for the
  155. Berkeley UNIX version.  Marcello supplied the SunLink X.25 code.  Paul
  156. Placeway, Rick Watson, Peter Svanberg, Paul Kline, and Michel Robitaille
  157. contributed enormously to the Macintosh version (and continue to do so).  The
  158. two Chris's, and more recently Kai-Uwe, for the OS/2 version; Terry, William,
  159. James, Mark for the VAX/VMS version; Steve for the Amiga version; Christian for
  160. the OS-9 version; Bruce for the Atari ST version.
  161.  
  162. Chuck found and fixed many bugs and contributed many valuable insights, as well
  163. as writing the UNIX "man page" for C-Kermit 5A.
  164.  
  165. And thanks to the indefatigable and omniscient Joe Doupnik (author of MS-DOS
  166. Kermit), who worked closely with the authors on the design of the sliding
  167. window algorithms, the script programming language, and the international
  168. character set support during the joint development effort for MS-DOS Kermit 3.0
  169. and C-Kermit 5A (and in his spare time, Joe lent a hand with the AT&T 7300 UNIX
  170. PC version of C-Kermit).  And finally, thanks to the dozens (hundreds) of
  171. others who tested C-Kermit on dozens (hundreds) of hardware and software
  172. platforms and contributed bug reports, fixes, new features, and suggestions:
  173.  
  174.    Chris Adie, Edinburgh U, Scotland (OS/2 support)
  175.    Robert Adsett, University of Waterloo, Canada
  176.    Larry Afrin, Clemson U
  177.    Barry Archer, U of Missouri
  178.    Robert Andersson, International Systems A/S, Oslo, Norway
  179.    Chris Armstrong, Brookhaven National Lab (OS/2)
  180.    William Bader, Moravian College
  181.    Fuat Baran, CUCCA
  182.    Stan Barber, Rice U
  183.    Jim Barbour, U of Colorado
  184.    Donn Baumgartner, Dell
  185.    Nelson Beebe, U of Utah
  186.    Karl Berry, UMB
  187.    Dean W Bettinger, SUNY
  188.    Gary Bilkus
  189.    Marc Boucher, U of Montreal
  190.    Charles Brooks, EDN
  191.    Bob Brown
  192.    Mike Brown, Purdue U
  193.    Jack Bryans, California State U at Long Beach
  194.    Mark Buda, DEC (VAX/VMS)
  195.    Bjorn Carlsson, Stockholm University Computer Centre QZ, Sweden
  196.    Bill Catchings, formerly of CUCCA
  197.    Bob Cattani, Columbia U CS Dept
  198.    Davide Cervone, Rochester University
  199.    Seth Chaiklin, Denmark
  200.    John Chandler, Harvard U / Smithsonian Astronomical Observatory
  201.    John L Chmielewski, AT&T, Lisle, IL
  202.    Howard Chu, U of Michigan
  203.    Bill Coalson, McDonnell Douglas
  204.    Bertie Coopersmith, London, UK
  205.    Chet Creider, University of Western Ontario, Canada
  206.    Alan Crosswell, CUCCA
  207.    Jeff Damens, formerly of CUCCA
  208.    Mark Davies, Bath U, UK
  209.    S. Dezawa, Fujifilm, Japan
  210.    Joe R. Doupnik, Utah State U
  211.    Frank Dreano (Honeywell)
  212.    John Dunlap, University of Washington
  213.    David Dyck, John Fluke Mfg Co.
  214.    Bernie Eiben, DEC
  215.    Kristoffer Eriksson, Peridot Konsult AB, Oerebro, Sweden
  216.    John R. Evans, IRS, Kansas City
  217.    Glenn Everhart, RCA Labs
  218.    Herm Fischer, Encino, CA (extensive contributions to version 4.0)
  219.    Carl Fongheiser, CWRU
  220.    Marcello Frutig, Catholic University, Sao Paulo, Brazil (X.25 support)
  221.    Hirofumi Fujii, Japan Nat'l Lab for High Energy Physics, Tokyo (Kanji)
  222.    Chuck Fuller, PSC
  223.    Andy Fyfe, Caltech
  224.    Christine M. Gianone, CUCCA
  225.    John Gilmore, UC Berkeley
  226.    German Goldszmidt, IBM
  227.    Alistair Gorman, New Zealand
  228.    Chris Green, Essex U, UK
  229.    Alan Grieg, Dundee Tech, Scotland, UK
  230.    Yekta Gursel, MIT
  231.    Jim Guyton, Rand Corp
  232.    Michael Haertel
  233.    Marion Hakanson
  234.    John Hamilston, Iowa State U
  235.    Simon Hania, Netherlands
  236.    Stan Hanks, Rice U.
  237.    Ken Harrenstein, SRI
  238.    James Harvey, Indiana/Purdue U (VMS)
  239.    Rob Healey
  240.    Chuck Hedrick, Rutgers U
  241.    Ron Heiby, Technical Systems Division, Motorola Computer Group
  242.    Steve Hemminger, Tektronix
  243.    Christian Hemsing, RWTH Aachen, Germany (OS-9)
  244.    Andrew Herbert, Monash Univ, Australia
  245.    Mike Hickey, ITI
  246.    R E Hill
  247.    Bill Homer, Cray Research
  248.    Randy Huntziger, National Library of Medicine
  249.    Larry Jacobs, Transarc
  250.    Steve Jenkins, Lancaster University, UK
  251.    Mark B Johnson, Apple Computer
  252.    Eric F Jones, AT&T
  253.    Luke Jones, AT&T
  254.    Peter Jones, U of Quebec Montreal
  255.    Phil Julian, SAS Institute
  256.    Mic Kaczmarczik, U of Texas at Austin
  257.    Sergey Kartashoff, Inst. of Precise Mechanics & Computer Equipment, Moscow
  258.    Howie Kaye, CUCCA
  259.    Rob Kedoin, Linotype Co, Hauppauge, NY (OS/2)
  260.    Mark Kennedy, IBM
  261.    Terry Kennedy, St Peter's College, Jersey City, NJ (VAX/VMS, 2.11 BSD)
  262.    Douglas Kingston, morgan.com
  263.    Tom Kloos, Sequent Computer Systems
  264.    Jim Knutson, U of Texas at Austin
  265.    David Kricker, Encore Computer
  266.    Thomas Krueger, UWM
  267.    Bo Kullmar, Central Bank of Sweden, Kista
  268.    John Kunze, UC Berkeley
  269.    Bob Larson, USC (OS-9)
  270.    Bert Laverman, Groningen U, Netherlands
  271.    Steve Layton
  272.    David Lawyer, UC Irvine
  273.    S.O. Lidie, Lehigh U
  274.    Tor Lillqvist, Helsinki University, Finland
  275.    Dean Long
  276.    Kevin Lowey, U of Saskatchewan (OS/2)
  277.    Andy Lowry, Columbia University
  278.    David MacKenzie, Environmental Defense Fund, University of Maryland
  279.    John Mackin, University of Sidney, Australia
  280.    Martin Maclaren, Bath U, UK
  281.    Chris Maio, Columbia U CS Dept
  282.    Fulvio Marino, Olivetti, Ivrea, Italy
  283.    Peter Mauzey, AT&T
  284.    Tye McQueen, Utah State U
  285.    Ted Medin
  286.    Hellmuth Michaelis
  287.    Leslie Mikesell, American Farm Bureau
  288.    Martin Minow, DEC (VAX/VMS)
  289.    Pawan Mistra, Bellcore
  290.    Ken Mizialko, IBM, Manassas, VA
  291.    Ray Moody, Purdue U
  292.    Bruce J Moore, Allen-Bradley Co, Highland Heights, OH (Atari ST)
  293.    Steve Morley, Convex
  294.    Peter Mossel, Columbia University
  295.    Tony Movshon, NYU
  296.    Lou Muccioli, Swanson Analysis Systems
  297.    Dan Murphy
  298.    Gary Mussar
  299.    John Nall, FSU
  300.    Jack Nelson, University of Pittsburgh
  301.    Jim Noble, Planning Research Corporation (Macintosh)
  302.    Ian O'Brien, Bath U, UK
  303.    John Owens
  304.    Andre Pirard, University of Liege, Belgium
  305.    Paul Placeway, Ohio State U (Macintosh & more)
  306.    Piet W. Plomp, ICCE, Groningen University, Netherlands
  307.    Ken Poulton, HP Labs
  308.    Manfred Prange, Oakland U
  309.    Frank Prindle, NADC
  310.    Tony Querubin, U of Hawaii
  311.    Anton Rang
  312.    Scott Ribe
  313.    Alan Robiette, Oxford University, UK
  314.    Michel Robitaille, U of Montreal (Mac)
  315.    Kai Uwe Rommel, Technische Universitat Munchen (OS/2)
  316.    Larry Rosenman (Amiga)
  317.    Jay Rouman, U of Michigan
  318.    Jack Rouse, SAS Institute (Data General and/or Apollo)
  319.    Stew Rubenstein, Harvard U (VAX/VMS)
  320.    Bill Schilit, Columbia University
  321.    Eric Schnoebelen, Convex
  322.    Benn Schreiber, DEC
  323.    Dan Schullman, DEC (modems, DIAL command, etc)
  324.    John Schultz, 3M
  325.    Steven Schultz, Contel (PDP-11)
  326.    APPP Scorer, Leeds Polytechnic, UK
  327.    Gordon Scott, Micro Focus, Newbury UK
  328.    Gisbert W. Selke, WIdO, Bonn, Germany
  329.    David Sizeland, U of London Medical School
  330.    Fridrik Skulason, Iceland
  331.    Dave Slate
  332.    Bradley Smith, UCLA
  333.    Richard S Smith, Cal State
  334.    Ryan Stanisfer, UNT
  335.    Bertil Stenstroem, Stockholm University Computer Centre (QZ), Sweden
  336.    Peter Svanberg, Royal Techn. HS, Sweden
  337.    Andy Tanenbaum, Vrije U, Amsterdam, Netherlands
  338.    Markku Toijala, Helsinki U of Technology
  339.    Rick Troxel, NIH
  340.    Warren Tucker, Tridom Corp, Mountain Park, GA
  341.    Dave Tweten, AMES-NAS
  342.    G Uddeborg, Sweden
  343.    Walter Underwood, Ford Aerospace
  344.    Pieter Van Der Linden, Centre Mondial, Paris
  345.    Ge van Geldorp, Netherlands
  346.    Fred van Kempen, MINIX User Group, Voorhout, Netherlands
  347.    Wayne Van Pelt, GE/CRD
  348.    Mark Vasoll, Oklahoma State U (V7 UNIX)
  349.    Konstantin Vinogradov, ICSTI, Moscow
  350.    Paul Vixie, DEC
  351.    Dimitri Vulis, CUNY
  352.    Roger Wallace, Raytheon
  353.    Stephen Walton, Calif State U, Northridge (Amiga)
  354.    Jamie Watson, Adasoft, Switzerland (RS/6000)
  355.    Rick Watson, U of Texas (Macintosh)
  356.    Robert Weiner
  357.    Lauren Weinstein
  358.    Joachim Wiesel, U of Karlsruhe, Germany
  359.    Michael Williams, UCLA
  360.    Nate Williams, U of Montana
  361.    David Wilson
  362.    Patrick Wolfe, Kuck & Associates, Inc.
  363.    Gregg Wonderly, Oklahoma State U (V7 UNIX)
  364.    Farrell Woods, Concurrent (formerly Masscomp)
  365.    Dave Woolley, CAP Communication Systems, London
  366.    Jack Woolley, SCT Corp
  367.    Frank Wortner
  368.    Ken Yap, U of Rochester
  369.    John Zeeff, Ann Arbor, MI
  370.  
  371. 1.2. Introduction
  372.  
  373. C-Kermit is a communication software program written in C that provides a full
  374. implementation of the Kermit file transfer protocol, plus terminal connection,
  375. modem dialing, file management, and a powerful script programming language.  An
  376. important goal of C-Kermit is transportability to different computers and
  377. operating systems.  To date, C-Kermit (one release or another) has been adapted
  378. to UNIX (most versions), VAX/VMS, Data General AOS/VS, IBM OS/2, the Apple
  379. Macintosh, the Commodore Amiga, the Atari ST, Apollo Aegis, OS-9, NCR 9800/VE,
  380. and others.
  381.  
  382. C-Kermit offers you several methods of interaction.  On UNIX, VAX/VMS, and most
  383. other systems, you have access to Kermit's interactive command parser, and you
  384. can also invoke Kermit with command line options.  On workstations like the
  385. Macintosh, there is a mouse-and-window interface with pull-down menus, radio
  386. buttons, and so forth.  In some cases, you have both.
  387.  
  388. Interactive operation gives you full access to all of C-Kermit's features.
  389. Command-line invocation gives you access to a small but useful subset.
  390. Command-line operation is described in Section 1.15.
  391.  
  392. The main part of document concentrates on the general features of C-Kermit.
  393. Sections specific to certain systems -- UNIX, VAX/VMS, OS/2, the Amiga, OS-9 --
  394. appear at the end.  Material about some of the implementations remains to be
  395. added.  Macintosh Kermit will be documented in a separate publication.
  396.  
  397. PLEASE NOTE: This manual describes a full-featured version of C-Kermit.
  398. However, some computers do not have address spaces (or C compilers, or linkers)
  399. capable of supporting all Kermit's features, so some features might be missing
  400. from your version.  See the file ckuins.doc for details.
  401.  
  402. 1.3. Kermit Software for Other Computers
  403.  
  404. Kermit software is available from Columbia University for almost every known
  405. computer and operating system, written in a wide variety languages.  For a
  406. catalog of Kermit software and ordering information, write to:
  407.  
  408.   Kermit Distribution
  409.   Columbia University Center for Computing Activities
  410.   612 West 115th Street
  411.   New York, NY  10025
  412.   USA
  413.  
  414. or call:
  415.  
  416.   (USA) (212) 854-3703
  417.  
  418. MS-DOS Kermit for the IBM PC, PS/2, and compatibles is also available in
  419. bookstores, computer stores, and from the publisher:
  420.  
  421.   Christine M. Gianone, Using MS-DOS Kermit, Second Edition, Digital Press,
  422.   Bedford, MA, 1991, 345 pages.  Packaged with MS-DOS Kermit for the IBM PC,
  423.   PS/2, and compatibles on a 5.25-inch diskette.
  424.  
  425.       Order Number: EY-H893E-DP
  426.       Digital Press ISBN: 1-55558-082-3
  427.       Prentice Hall ISBN: 0-13-952276-X
  428.  
  429.       Internation Edition Order Number: EY-H893E-DI
  430.       International Prentice Hall ISBN: 0-13-953043-6
  431.  
  432.   US single-copy price: $34.95; quantity discounts available.  Available in
  433.   computer bookstores or directly from Digital Press.  In the USA, call Digital
  434.   Press toll-free 1-800-344-4825 to order; major credit cards accepted.
  435.   Overseas, order through your bookstore or your local Digital Equipment
  436.   Corporation branch.
  437.  
  438. A German-language edition is also available:
  439.  
  440.   Christine M. Gianone, MS-DOS Kermit, Das universelle Kommunikationsprogramm,
  441.   Verlag Heinz Heise, Hannover, Germany (1991), 414 pages.  Translated by
  442.   Gisbert W. Selke.  Packaged with version 3.11 of MS-DOS Kermit for the IBM
  443.   PC, PS/2, and compatibles on a 5.25-inch diskette, including German language
  444.   help files.  ISBN 3-88229-006-4
  445.  
  446. 1.4. Interactive Operation
  447.  
  448. C-Kermit's interactive command prompt is "C-Kermit>".  In response to this
  449. prompt, you can type any valid interactive C-Kermit command.  C-Kermit executes
  450. the command and then prompts you for another command.  The process continues
  451. until you instruct the program to terminate.
  452.  
  453. Commands begin with a keyword, normally an English verb, such as "send".  You
  454. may omit trailing characters from any keyword, as long as you specify
  455. sufficient characters to distinguish it from any other keyword valid in that
  456. field.  Certain commonly-used keywords (such as "send", "receive", "connect")
  457. also have special non-unique abbreviations ("s" for "send", "r" for "receive",
  458. "c" for "connect").
  459.  
  460. Command keywords can be entered in either upper or lower case, or any
  461. combination.  This manual shows command keywords in uppercase for clarity.
  462.  
  463. Certain characters have special functions while you are typing interactive
  464. commands:
  465.  
  466.     ?   Question mark, typed at any point in a command, will produce a message
  467.         explaining what is possible or expected at that point.  Depending on
  468.         the context, the message may be a brief phrase, a menu of keywords, or
  469.         a list of files.  Use "?" liberally to feel your way through Kermit's
  470.         commands.
  471.  
  472.     ESC (The Escape or Altmode key) -- Request completion of the current
  473.         keyword or filename, or insertion of a default value.  The result will
  474.         be a beep if the requested operation fails.
  475.  
  476.     TAB (The horizontal Tab key) -- Same as ESC.
  477.  
  478.     DEL (The Delete or Rubout key) -- Delete the previous character from the
  479.         command.  You may also use BS (Backspace, Control-H) for this function.
  480.  
  481.     ^W  (Control-W) -- Erase the rightmost word from the command line.
  482.  
  483.     ^U  (Control-U) -- Erase the entire command.
  484.  
  485.     ^R  (Control-R) -- Redisplay the current command.
  486.  
  487.     ^C  (Control-C) -- Interrupt a command.
  488.  
  489.     SP  (Space) -- Delimits fields (keywords, filenames, numbers) within a
  490.         command.
  491.  
  492.     CR  (Carriage Return) -- Enters the command for execution.  LF (Linefeed)
  493.         or FF (formfeed) may also be used for this purpose.
  494.  
  495.     \   (Backslash) -- Enter any of the above characters into the command
  496.         literally.  To enter a backslash, type two backslashes in a row (\\).
  497.         A backslash at the end of a command line causes the next line to be
  498.         treated as a continuation line; this is useful for readability in
  499.         command files.  Backslash is also used to introduce special characters,
  500.         variable names, and functions.  These are explained in Section 1.12.
  501.  
  502.     ^Z  (Control-Z) -- On systems (like Berkeley UNIX, Ultrix) with job
  503.         control, Control-Z is supposed to suspend Kermit, i.e. put it into the
  504.         background in such a way that it can be brought back into the
  505.         foreground (e.g. with an 'fg' shell command) with all its settings
  506.         intact.
  507.  
  508. You may type the editing characters (DEL, ^W, etc) repeatedly, to delete all
  509. the way back to the prompt.  No action will be performed until the command is
  510. entered by typing carriage return, linefeed, or formfeed.  If you make any
  511. mistakes, you will receive an informative error message and a new prompt --
  512. make liberal use of `?' and ESC to feel your way through the commands.  One
  513. important command is "help" -- you should use it the first time you run
  514. C-Kermit.
  515.  
  516. Comments may be entered as entire commands, or may appear at the end of any
  517. command.  Comments are introduced by semicolon (;) or pound sign (#).
  518.  
  519. Interactive C-Kermit accepts commands from files as well as from the keyboard.
  520. When you start C-Kermit, the program looks for a special file, the Kermit
  521. Initialization File in your home or current directory (first it looks in the
  522. home directory, then in the current one) and executes any commands it finds
  523. there.  These commands must be in interactive format, not command-line format.
  524. The name of the initialization file is .kermrc in UNIX and OS-9, and
  525. CKERMIT.INI in most other operating systems.
  526.  
  527. Here is a brief list of C-Kermit interactive commands:
  528.  
  529.               ;  Introduce a full-line or trailing comment (also #).
  530.               !  Execute a system command or enter system command interpreter.
  531.               @  Same as !.
  532.             ASK  Prompt the user, store user's reply in a variable.
  533.            ASKQ  Like ASK, but, but doesn't echo (useful for passwords).
  534.          ASSIGN  Assign an evaluated string to a variable or macro.
  535.             BUG  Instructions for reporting bugs.
  536.             BYE  Terminate and log out a remote Kermit server.
  537.              CD  Change Working Directory (also, CWD).
  538.           CLEAR  Clear communication device input buffer.
  539.           CLOSE  Close a log or other local file.
  540.         COMMENT  Introduce a full-line comment.
  541.         CONNECT  Establish a terminal connection to a remote computer.
  542.         DECLARE  Declare an array.
  543.       DECREMENT  Subtract one (or other number) from a variable.
  544.          DEFINE  Define a variable or macro.
  545.          DELETE  Delete a file or files.
  546.            DIAL  Dial a telephone number.
  547.       DIRECTORY  Display a directory listing.
  548.         DISABLE  Disallow access to selected features during server operation.
  549.              DO  Execute a macro.
  550.            ECHO  Display text on the screen.
  551.            ELSE  ELSE-part of an IF command.
  552.          ENABLE  Allow access to selected features during server operation.
  553.             END  A command file or macro.
  554.            EXIT  Exit from the program, closing all open files and devices.
  555.          FINISH  Instruct a remote Kermit server to exit, but not log out.
  556.             FOR  Execute commands repeatedly in a counted loop.
  557.             GET  Get files from a remote Kermit server.
  558.            GOTO  Go to a labeled command in a command file or macro.
  559.          HANGUP  Hang up the phone or network connection.
  560.            HELP  Display a help message for a given command.
  561.              IF  Conditionally execute the following command.
  562.       INCREMENT  Add one (or other number) to a variable.
  563.           INPUT  Match characters from another computer against a given text.
  564.             LOG  Open a log file -- debugging, packet, session, transaction.
  565.            MAIL  Send a file as electronic mail to a specified address.
  566.           MSEND  Multiple SEND -- send a list of files.
  567.            OPEN  Open a local file for reading or writing.
  568.          OUTPUT  Send text to another computer.
  569.             PAD  (X.25 version only) Give X.25 PAD commands.
  570.           PAUSE  Do nothing for a given number of seconds.
  571.           PRINT  Print a local file on a local printer.
  572.            PUSH  Invoke host system interactive command interpreter.
  573.             PWD  Display current working device/directory.
  574.            QUIT  Same as EXIT.
  575.            READ  Read a line from a local file.
  576.         RECEIVE  Passively wait for files to arrive.
  577.          REDIAL  Redial the most recently dialed phone number.
  578.         REINPUT  Reexamine text previously received from another computer.
  579.          REMOTE  Issue file management commands to a remote Kermit server.
  580.          RENAME  Change the name of a file.
  581.          RETURN  Return from a user-defined function.
  582.             RUN  Run a program or system command.
  583.          SCRIPT  Execute a UUCP-style login script.
  584.            SEND  Send files.
  585.          SERVER  Begin server operation.
  586.             SET  Set various parameters.
  587.            SHOW  Display values of SET parameters.
  588.           SPACE  Display current disk space usage.
  589.      STATISTICS  Display statistics about most recent transaction.
  590.            STOP  Stop executing macro or command file and return to the prompt.
  591.         SUSPEND  Put the Kermit program in the backgound.
  592.            TAKE  Execute commands from a file.
  593.          TELNET  Start a TCP/IP TELNET session.
  594.        TRANLATE  Translate a file's character set.
  595.        TRANSMIT  Upload a file with no error checking.
  596.            TYPE  Display a file on the screen.
  597.         VERSION  Display the program version number on the screen.
  598.            WAIT  Wait for the specified modem signals.
  599.           WHILE  Execute commands repeatedly while a condition is true.
  600.           WRITE  Write text to a local file.
  601.             XIF  Extended IF command.
  602.  
  603. On most computers, C-Kermit can be started simply by typing the word "kermit"
  604. (followed by carriage return).  If no command-line "action options" are
  605. included, Kermit will automatically enter interactive prompting mode.  Let's
  606. begin by looking at a few of C-Kermit's basic interactive commands.  Most
  607. important of all when you are just beginning are the commands to exit from the
  608. program and to get help about it.
  609.  
  610.  
  611. The EXIT and QUIT Commands
  612.  
  613. Syntax: EXIT [ number ] Syntax: QUIT [ number ]
  614.  
  615. These two commands are identical.  Both of them do the following:
  616.  
  617.    - Hangs up the modem, if the communications line supports data terminal
  618.      ready.
  619.    - Relinquish access to any communication line assigned via SET LINE, or
  620.      any network connection obtained via SET HOST.
  621.    - Relinquish any uucp and multiuser locks on the communications line
  622.      (UNIX only).
  623.    - Close all open logs or other files.
  624.    - Attempt to insure that your terminal is returned to normal.
  625.  
  626. After exit from C-Kermit, your default directory will be the same as when you
  627. started the program.  The EXIT command is issued implicitly whenever C-Kermit
  628. halts normally, e.g. after a command line invocation, or after certain kinds of
  629. interruptions.
  630.  
  631. C-Kermit returns an exit status of zero, except when an error is encountered,
  632. where the exit status is set to a nonzero number, depending on the operating
  633. system.  In UNIX, the exit status is the sum of 1 (if any SEND commands
  634. failed), 2 (if any RECEIVE or GET commands failed), and 4 (if any REMOTE
  635. commands failed).  If you give a number after the EXIT or QUIT command, that
  636. number is returned instead.
  637.  
  638.  
  639. The HELP Command
  640.  
  641. Syntax: HELP [ { command, { SET, REMOTE } parameter } ]
  642.  
  643. Brief help messages or menus are always available at interactive command level
  644. by typing a question mark at any point.  A slightly more verbose form of help
  645. is available through the HELP command.  The HELP command with no arguments
  646. prints a brief summary of how to enter commands and how to get further help.
  647. HELP may be followed by one of the top-level C-Kermit command keywords, such as
  648. SEND, to request information about a command.  Commands such as SET and REMOTE
  649. have a further level of help.  Thus you may type HELP, HELP SET, or HELP SET
  650. PARITY; each will provide a successively more detailed level of help.
  651.  
  652.  
  653. The TAKE Command
  654.  
  655. Syntax: TAKE fn1
  656.  
  657. The TAKE command instructs C-Kermit to execute commands from the named file.
  658. The file may contain any interactive C-Kermit commands, including TAKE; command
  659. files may be nested to any reasonable depth, but it may not contain text to be
  660. sent to a remote system during the CONNECT command; Use scripts for that (see
  661. sections 1.13 and 1.14).
  662.  
  663. Echoing of commands from TAKE files and handling of errors during TAKE file
  664. execution are controlled by the SET TAKE command.
  665.  
  666. Comments may be included in take-command files.  Whole-line comments may begin
  667. with the word COMMENT.  Both trailing and whole-line comments can be introduced
  668. using semicolon or pound sign, for example:
  669.  
  670.     COMMENT - Commands to dial out out using a Hayes modem...
  671.     set modem hayes        ; Specify the kind of modem
  672.     set line /dev/ttyh8    ; Select a terminal device
  673.     set speed 19200        ; Set the speed
  674.     dial 7654321           ; Dial the number
  675.  
  676. TAKE-command files are in exactly the same syntax as interactive commands.  If
  677. you want to include special characters like question mark or backslash that you
  678. would have to quote with backslash when typing interactive commands, you must
  679. quote these characters the same way in command files.  Long lines may be
  680. continued by ending them with a single backslash or a dash:
  681.  
  682.     set\
  683.     modem\
  684.     hayes
  685.     set-
  686.     line /dev-
  687.     /ttyh8
  688.  
  689. Continued lines cannot have trailing comments.  If you put a trailing comment
  690. after the dash, then Kermit will not treat the line as continued.  If you put a
  691. dash at the end of a trailing comment, then Kermit will treat the next line as
  692. a continuation of the comment.
  693.  
  694. An implicit TAKE command is executed upon your C-Kermit initialization file
  695. (.kermrc in UNIX, CKERMIT.INI elsewhere) when C-Kermit starts up, upon either
  696. interactive or command-line invocation.  The initialization file may contain
  697. SET or other commands you want to be in effect at all times.  For instance, you
  698. might want override the default action when incoming files have the same names
  699. as existing files -- in that case, put a command like:
  700.  
  701.     set file collision overwrite
  702.  
  703. Under UNIX, you may also use the shell's redirection mechanism to cause
  704. C-Kermit to execute commands from a file:
  705.  
  706.     kermit < cmdfile
  707.  
  708. or you can even pipe commands in from another process:
  709.  
  710.     command | kermit
  711.  
  712.  
  713. 1.5. Establishing the Connection
  714.  
  715. In order to talk about a connection between two computers, we a way to
  716. distinguish between them.  The local computer is the one that you are using
  717. most directly -- a PC or workstation on your desk, or a timesharing computer
  718. that you are using from a terminal.  Kermit lets you make a connection from the
  719. local computer to a remote computer, for example by dialing it up with a modem.
  720. The Kermit program on your local computer is said to be in "local mode" and the
  721. Kermit program on the remote computer is in "remote mode".
  722.  
  723. C-Kermit can be used in either remote or local mode.  If you are using C-Kermit
  724. in remote mode, you can skip ahead to Section 1.6, File Transfer.
  725.  
  726. If you are using C-Kermit in local mode, you must have one of three kinds of
  727. connections to the remote computer:
  728.  
  729.    1. A hardwired asynchronous serial connection, either directly to the
  730.       other computer, or through some kind of terminal server or switching
  731.       device.
  732.  
  733.    2. A dialup connection, which you establish by dialing with a modem.
  734.  
  735.    3. A network connection.
  736.  
  737. To prepare C-Kermit for these connections, several preliminary steps are
  738. necessary using the SET command, which is described in Section 1.11, below:
  739.  
  740.    1. Direct connection: SET LINE device-name, SET SPEED bits-per-second.
  741.  
  742.    2. Dialup connection, which you establish by dialing with a modem: SET
  743.       MODEM modem-type, SET LINE device-name, SET SPEED bits-per-second,
  744.       DIAL phone-number.
  745.  
  746.    3. Network connection: SET HOST network-host-name.  If your version of
  747.       C-Kermit supports more than one type of network, give the
  748.       appropriate SET NETWORK command before the SET HOST command (the
  749.       default network type is TCP/IP).  (Also see the TELNET command,
  750.       described below.)
  751.  
  752. In addition, you must establish whatever other communication related settings
  753. are appropriate for the connection, including PARITY, DUPLEX, FLOW, and
  754. HANDSHAKE.  Having done all this, you can use the CONNECT command to begin a
  755. terminal session with the remote computer, and once connected, you can initiate
  756. file transfers.
  757.  
  758.  
  759. The SET LINE Command
  760.  
  761. Syntax: SET LINE [ device ]
  762.  
  763. Close any previously open network, terminal, or modem connection.  If a device
  764. name is given, try to open the device for communication.  If no device name is
  765. given, revert to the default mode of communication (normally remote mode).
  766.  
  767.  
  768. The SET HOST Command
  769.  
  770. Syntax: SET HOST [ host [ service ] ]
  771.  
  772. Close any previously open network, terminal, or modem connection.  If the
  773. current network type (see SET NETWORK) is TCP/IP, the host field can be
  774. specified as an IP host name or a numeric IP host address, followed optionally
  775. by a TCP service name or port number (the default service is TELNET, TCP port
  776. number 23).  If the network type is X.25, the host field is an X.121 address,
  777. and there is no service field.  If no host name is given, revert to the default
  778. mode of communication (normally remote mode).
  779.  
  780.  
  781. The CONNECT Command
  782.  
  783. The CONNECT command (C is a special abbreviation for CONNECT) links your
  784. terminal to another computer as if it were a local terminal to that computer,
  785. through the device specified in the most recent SET LINE or SET HOST command,
  786. or through the default device if your system is a PC or workstation.  All
  787. characters you type at your keyboard are sent out the communication line (and
  788. if you have SET DUPLEX HALF, also displayed on your screen), and all characters
  789. arriving at the communication port are displayed on the screen.  Current
  790. settings of speed, parity, duplex, and flow-control are honored, and the data
  791. connection is 7 bits wide unless you have given the command SET TERMINAL
  792. BYTESIZE 8.  If you have issued a LOG SESSION command, everything you see on
  793. your screen will also be recorded to your session log.  This provides a way to
  794. "capture" files from remote systems that don't have Kermit programs available.
  795.  
  796. To get back to your own system, you must type the "escape character", which is
  797. Control-Backslash (^\) unless you have changed it with the SET ESCAPE command,
  798. followed by a single-character command, such as C for "close connection".
  799. Single-character commands may be entered in upper or lower case.  They include:
  800.  
  801.   C     Return to C-Kermit.  If you gave an interactive CONNECT command, return
  802.         to the C-Kermit prompt.  If you gave a -c or -n option on the command
  803.         line, close the connection and return to the system prompt.
  804.   B     Send a BREAK signal (about 0.275 sec).
  805.   L     Send a Long BREAK signal (about 1.5 sec).
  806.   0     (zero) send a null.
  807.   S     Give a status report about the connection.
  808.   H     Hangup the phone.
  809.   !     Escape to the system command processor "under" Kermit.  Exit or logout
  810.         to return to your CONNECT session.
  811.   Z     Suspend Kermit (UNIX only).
  812.   \nnn  A character in backslash-code form.
  813.   ^\    Send Control-Backslash itself (whatever you have defined the escape
  814.         character to be, typed twice in a row sends one copy of it).
  815.  
  816. Uppercase and control equivalents for (most of) these letters are also
  817. accepted.  A space typed after the escape character is ignored.  Any other
  818. character will produce a beep.
  819.  
  820. The connect command simply displays incoming characters on the screen.  It is
  821. assumed any screen control sequences sent by the host will be handled by the
  822. firmware or emulation software in your terminal or PC(Several C-Kermit
  823. implementations include terminal emulators, notably Macintosh and OS/2).
  824.  
  825. It is sometimes useful to see exactly what characters the host is transmitting,
  826. rather than having your terminal or emulator interpret them for you.  If you
  827. give the command SET DEBUG SESSION, then during CONNECT, C-Kermit will display
  828. control characters using "uparrow" notation, for example ^A for Control-A, ^B
  829. for Control-B, etc, ^[ for ESC.  8-bit characters are preceded by a tilde (~)
  830. character.
  831.  
  832.  
  833. The DIAL and REDIAL Commands
  834.  
  835. Syntax: DIAL telephone-number
  836. Syntax: REDIAL
  837.  
  838. The DIAL command controls dialout modems; you should have already issued a SET
  839. MODEM command to identify the type of modem to be used for dialing, and then
  840. SET LINE and SET SPEED commands to identify the terminal device to which the
  841. modem is connected, plus any desired SET CARRIER and SET DIAL commands to
  842. modify the behavior of the DIAL command itself.
  843.  
  844. In the DIAL command, you supply the phone number and the Kermit program feeds
  845. it to the modem in the appropriate format and then interprets dialer return
  846. codes and modem signals to inform you whether the call was completed.  These
  847. actions are based upon built-in knowledge of the control sequences and
  848. responses of each make and model of modem that C-Kermit knows about.
  849.  
  850. The telephone-number may contain imbedded modem-dialer commands appropriate to
  851. the selected modem type, such as comma for Hayes pause, or `&' for Ventel
  852. dialtone-wait and `%' for Ventel pause (consult your modem manual for details).
  853.  
  854. The REDIAL command is exactly like the DIAL command, except it uses the phone
  855. number you specified in your most recent DIAL command.
  856.  
  857. At the time of this writing, support is included for the following modems:
  858.  
  859.    - AT&T 7300 Internal Modem
  860.    - AT&T 2212C, 2224B, 2224CEO, and 2296A switched network modems in AT&T
  861.      mode
  862.    - AT&T Digital Terminal Data Module (DTDM)
  863.    - Cermetek Info-Mate 212A
  864.    - Concord Condor CDS 220
  865.    - Courier HST
  866.    - DEC DF03-AC
  867.    - DEC DF100 Series
  868.    - DEC DF200 Series
  869.    - General DataComm 212A/ED
  870.    - Hayes Smartmodem and compatibles
  871.    - IBM/Siemens/Rolm 9751 CBX DCM
  872.    - Microcom AX-9624
  873.    - Penril
  874.    - Racal Vadic
  875.    - Telebit Trailblazer, T1000, T1600, T2500
  876.    - US Robotics 212A
  877.    - Ventel
  878.  
  879. Support for new modems is added to the program from time to time; you can check
  880. the current list by typing SET MODEM ?.
  881.  
  882. There are also two "generic" modem types -- DIRECT (i.e. no modem at all, so
  883. that no attempt is made to deal with modem signals), and UNKNOWN (which tells
  884. C-Kermit to attempt to honor modem signals, but leaves the dialing mechanism
  885. unspecified).  NONE is a synonym for DIRECT.
  886.  
  887. The device used for dialing out is the one selected in the most recent SET LINE
  888. command (or on a workstation, the default line if no SET LINE command was
  889. given).  On UNIX systems, the DIAL command attempts to lock the terminal
  890. device's path and to establish a call on an exclusive basis.  If it is desired
  891. to dial a call and then return to the shell (such as to do Kermit activities
  892. depending on standard in/out redirection), it is necessary to place the dialed
  893. call under one device name (say, "/dev/cua0") and then escape to the shell
  894. within Kermit on a linked device which is separate from the dialed line (say,
  895. "/dev/cul0").  This is the same technique used by uucp (to allow locks to be
  896. placed separately for dialing and conversing).
  897.  
  898. Because modem dialers have strict requirements to override the carrier-detect
  899. signal most UNIX implementations expect, the sequence for dialing is more rigid
  900. than most other C-Kermit procedures.  Example:
  901.  
  902.     kermit
  903.     C-Kermit>set modem hayes      ; SET MODEM first!
  904.     C-Kermit>set carrier auto     ; Then SET CARRIER if necessary,
  905.     C-Kermit>set line /dev/acu2   ; Then SET LINE,
  906.     C-Kermit>set speed 2400       ; Then SET SPEED,
  907.     C-Kermit>set dial display on  ; Then SET DIAL if necessary,
  908.     C-Kermit>dial 9,5551212       ; and finally, DIAL.
  909.     Connected!                    ; If DIAL completes OK,
  910.     C-Kermit>connect              ; you can CONNECT.
  911.     logon, do things
  912.     ^\c
  913.     C-Kermit> ...
  914.     C-Kermit>quit                 ; Disconnect & unlock the line.
  915.  
  916. In general, C-Kermit requires that the modem provide the "carrier detect" (CD)
  917. signal when a call is in progress, and remove that signal when the call
  918. completes or the line drops.  If a modem switch setting is available to force
  919. CD, it should normally not be in that setting.  C-Kermit also requires (on most
  920. systems) that the modem track the computer's "data terminal ready" (DTR)
  921. signal.  If a switch setting is available to simulate DTR asserted within the
  922. modem, then it should normally not be in that setting.  Otherwise the modem
  923. will be unable to hang up at the end of a call or when interrupts are received
  924. by Kermit.
  925.  
  926. If you want to interrupt a DIAL command in progress (for instance, because you
  927. just realize that you gave it the wrong number), type a Control-C get back to
  928. command level.  If you are a UNIX user and your "interrupt character" is
  929. defined as something besides Ctrl-C, use that instead.
  930.  
  931. PROBLEMS: The DIAL command hangs up the phone (see HANGUP) prior to dialing.
  932. Because of the problems described for HANGUP, certain UNIX configurations are
  933. unable to use DIAL when it does this.  To work around this problem, give the
  934. command SET DIAL HANGUP OFF before giving the DIAL command.  If DIAL still
  935. doesn't work right, start over again but this time give the command SET CARRIER
  936. OFF prior to SET LINE.
  937.  
  938. See the command summary for a description of SET DIAL options.  You can use SET
  939. DIAL to modify the modem initialization string, the timeout period for call
  940. completion, and so on.
  941.  
  942. Hayes and Hayes-compatible, as well as Telebit, modem dialing is supported for
  943. both word and digit result codes, and C-Kermit will also attempt to adjust its
  944. communication speed in case these modems complete a call at a lower speed than
  945. it was placed at (if you have a speed-matching modem, you can defeat this
  946. action by giving the command SET DIAL SPEED-MATCHING ON before dialing).
  947.  
  948.  
  949. The HANGUP Command
  950.  
  951. The HANGUP command attempts to hang up the modem on a local-mode dialout
  952. connection established by SET LINE, or to hang up the network connection
  953. established by SET HOST, in order to break the connection.  On terminal
  954. devices, Kermit accomplishes the hangup by momentarily turning off the Data
  955. Terminal Ready (DTR) RS-232 signal.
  956.  
  957. The means used to drop DTR and bring it back up again are highly dependent on
  958. the computer, the version of UNIX, the communication device, the device driver,
  959. the modem being used, and even the cable that connects the modem to the
  960. communication device.  Therefore you might find that this command fails to
  961. operate as it should.
  962.  
  963. If the HANGUP command fails to hang up a phone connection, then maybe your
  964. modem is configured to ignore DTR.  You should make sure your modem is
  965. configured to pay attention to the computer's DTR signal.  Another possibility
  966. is that your cable is giving the modem a constant DTR signal, looped back from
  967. its own DSR signal; in that case, replace your cable with a regular
  968. straight-through modem cable.
  969.  
  970. If the HANGUP command does indeed hang up the phone connection, but then you
  971. can't communicate with the modem any more to establish a new connection, your
  972. version of UNIX may have dropped the DTR signal without bringing it back up
  973. again properly.  To work around this problem, give the SET LINE command (with
  974. no device name) to close the current device, and then another SET LINE command
  975. specifying the original device to open it again.
  976.  
  977.  
  978. The TELNET Command
  979.  
  980. Syntax: TELNET [ host [ service ] ]
  981.  
  982. The TELNET command can be used in C-Kermit implementations that support TCP/IP
  983. networking.  TELNET is simply a shorthand for SET HOST followed by CONNECT.  If
  984. you give an IP host name (or number), Kermit closes any currently open
  985. connection and begins a new one to the given host.  If the TCP/IP connection is
  986. made successfully, Kermit puts itself into CONNECT mode for terminal emulation.
  987. If you give a TELNET command without a hostname, the currently active TCP/IP
  988. session (if any) is resumed; if there is no current session, you'll get an
  989. error message.  The service can be a TCP port number or service name; the
  990. default is 23, the TELNET port.
  991.  
  992.  
  993. 1.6. File Transfer
  994.  
  995. Kermit programs can transfer files correctly and completely, using the Kermit
  996. file transfer protocol.  A Kermit program must be running on both computers.
  997. Here is the normal procedure:
  998.  
  999.    1. Run Kermit on your local computer.
  1000.  
  1001.    2. Make the appropriate communication settings (such as modem type,
  1002.       line, speed, parity, etc).
  1003.  
  1004.    3. Establish a connection to the remote computer (DIAL if necessary).
  1005.  
  1006.    4. CONNECT to the remote computer.
  1007.  
  1008.    5. Log in to the remote computer if necessary.
  1009.  
  1010.    6. Start Kermit on the remote computer and tell it to send (or receive)
  1011.       a file (or files).
  1012.  
  1013.    7. "Escape back" to the local computer.
  1014.  
  1015.    8. Tell the local computer to receive (or send) a file (or files).
  1016.  
  1017. When transferring files, C-Kermit converts between upper and lower case
  1018. filenames and between LF and CRLF line terminators automatically, unless told
  1019. to do otherwise.  When binary files must be transferred, the program should be
  1020. instructed not to perform LF/CRLF conversion (-i on the command line or SET
  1021. FILE TYPE BINARY interactively; see below).
  1022.  
  1023. If C-Kermit is in local mode, the screen is continously updated to show the
  1024. progress of the file transer.  A dot is printed for every four data packets,
  1025. other packets are shown by type:
  1026.  
  1027.     I Exchange Parameter Information
  1028.     R Receive Initiation
  1029.     S Send Initiatiation
  1030.     A Attribute Packet
  1031.     F File Header
  1032.     G Generic Server Command
  1033.     C Remote Host Command
  1034.     N Negative Acknowledgement (NAK)
  1035.     E Fatal Error
  1036.     T Indicates a timeout occurred
  1037.     Q Indicates a damaged, undesired, or illegal packet was received
  1038.     % Indicates a packet was retransmitted
  1039.  
  1040. You may type the following interruption commands during file transfer:
  1041.  
  1042.     F Interrupt the current File, and go on to the next (if any).
  1043.     X Interrupt the entire Batch of files, terminate the operation.
  1044.     R Resend the current packet.
  1045.     E Error: terminate the current operation immediately and return to prompt.
  1046.     A Display a status report for the current operation.
  1047.  
  1048. EMERGENCY EXIT:  When running C-Kermit in remote mode, if you have started a
  1049. protocol operation (sending or receiving a file, server command wait, etc), you
  1050. can type two Control-C's directly to the UNIX Kermit program ("connect" first
  1051. if necessary):
  1052.  
  1053.     Control-C Control-C
  1054.  
  1055. This will cause the program to display,
  1056.  
  1057.     ^C^C...
  1058.  
  1059. and return you to the C-Kermit prompt.
  1060.  
  1061. Before initiating a file transfer, you should be sure that all communication
  1062. and protocol-related settings are correct.  Version 5A of Kermit attempts to
  1063. make things easier for you in this area in several ways, for example by
  1064. recognizing file attributes (text or binary, character set, etc) from the other
  1065. Kermit if it sends them.  If your parity is set to NONE, C-Kermit automatically
  1066. recognizes parity bits on received packets, and adjusts its parity accordingly.
  1067. But it's better to set these C-Kermit parameters directly yourself to avoid any
  1068. confusion that might result from these automatic adjustments.
  1069.  
  1070.  
  1071. The SEND Command
  1072.  
  1073. Syntax:  SEND fn [ rfn1 ]
  1074.  
  1075. Send the file or files denoted by fn to the other Kermit, which should be
  1076. running as a server, or which should be given the RECEIVE command.  The SEND
  1077. command may be abbreviated to S, even though S is not a unique abbreviation for
  1078. a top-level C-Kermit command.  Each file is sent under its own name (as
  1079. described above, or as specified by the 'set file names' command).  If the
  1080. second form of the SEND command is used, i.e. with fn1 denoting a single file,
  1081. rfn1 may be specified as a name to send it under.  For example:
  1082.  
  1083.     send sows.ear silk.purse
  1084.  
  1085. sends the file sows.ear but tells the other Kermit that its name is silk.purse.
  1086.  
  1087.  
  1088. The MSEND Command
  1089.  
  1090. Syntax:  MSEND fn [ fn [ fn [ ... ] ] ]
  1091.  
  1092. The MSEND command also sends one or more files, but unlike the SEND command, it
  1093. allows you to give a list of files to send, and it does not allow you to
  1094. specify an alternate name.  The MSEND file specifications are separated by
  1095. spaces.
  1096.  
  1097. Both the SEND and MSEND commands allow you to use wildcard (meta) characters to
  1098. specify groups of files.  Exactly which wildcard characters are available
  1099. depend on the host operating system and other factors.  In VAX/VMS, they are
  1100. `*' and `%'.  In UNIX they are `~', `*', and `?'.  If `?'  is to be included,
  1101. it must be prefixed by `\' to override its normal function of providing help.
  1102. The `*' character matches any string, and `?' (UNIX) or `%' (VMS) matches any
  1103. single character.
  1104.  
  1105. When fn contains `*' or `?' characters, there is a limit to the number of files
  1106. that can be matched, which varies from system to system.  If you get the
  1107. message "Too many files match" then you'll have to make a more judicious
  1108. selection.  For example, if fn was of the form:
  1109.  
  1110.     usr/longname/anotherlongname/*
  1111.  
  1112. then C-Kermit's string space will fill up rapidly -- try using CD to change
  1113. your directory to the path in question and reissuing the command.
  1114.  
  1115. Wildcards do not descend through a directory tree.  Only files in the current
  1116. or specified directory are sent.
  1117.  
  1118. In UNIX versions of C-Kermit only, `~' is treated as a meta character if it is
  1119. the first character in the file specification. If it is followed immediately by
  1120. a slash, a space, or end of line, then your login directory name is
  1121. substituted.  If it is followed immediately by a username, then that user's
  1122. login directory name is substituted.  (In VAX/VMS, you can use logical names in
  1123. the file specification for the same purpose.)
  1124.  
  1125. Wildcard Notation for UNIX
  1126.  
  1127. Normally, C-Kermit expands wildcard characters itself by searching through the
  1128. disk and matching names against the pattern you specify.  But Kermit's
  1129. pattern-matching abilities are limited to the metacharacters listed above.
  1130. UNIX shells like csh and ksh, on the other hand, offer notations for file
  1131. groups, like `[bcdfhjlns]og' or `*.{txt,doc}' that Kermit cannot handle on its
  1132. own.  Kermit lets you get at these capabilities with the command:
  1133.  
  1134. SET WILDCARD-EXPANSION { KERMIT, SHELL }
  1135.  
  1136. The default is KERMIT, meaning Kermit itself expands wildcards in SEND and
  1137. MSEND, as well as what it receives while in server mode from GET commands.  The
  1138. SHELL option means Kermit calls upon the user's preferred shell (via the SHELL
  1139. environment variable, or failing that, the user's login shell via getpwuid) to
  1140. expand them.
  1141.  
  1142. Advantages of the SHELL method include more flexibility in file selection,
  1143. consistency with the user's shell, and ability to handle a larger number of
  1144. files.  But there are drawbacks.  It's noticably slower.  Characters in
  1145. filenames that are special to the shell (like |, &, `, etc) must be quoted with
  1146. \ (this is not necessary when Kermit expands).  And the same Kermit command
  1147. (SEND, MSEND, or GET sent to a server) may behave differently depending on what
  1148. your login shell is.  For example, "{aaa,bbb}" is expanded by the csh, but
  1149. taken literally by sh and ksh; "[a-z]" is expanded by csh and ksh, but taken
  1150. literally by sh.
  1151.  
  1152. The expansion is done by passing "echo " concatenated with your filespec to the
  1153. shell.  This assumes that echo is a built-in shell command, or if it's not,
  1154. then the echo program is in the user's path (risky).  "echo" is used rather
  1155. than "ls -d" because ls says "xxx not found" if xxx does not exist
  1156. (unfortunately, the csh version of "echo" says "echo: no match" if you give it
  1157. a string containing metacharacters and no files match, wherease sh and ksh
  1158. simply echo the string back at you).  It doesn't matter much, because C-Kermit
  1159. checks each word that is returned for its existence as a file (but of course,
  1160. you could have a file called "echo:", "no", or "match"...).  And then what
  1161. happens if your have a file called "-n"?  ("echo -n" is a command.  Refer to a
  1162. file called "-n" in the current directory as "./-n").
  1163.  
  1164. Text vs Binary Files
  1165.  
  1166. When C-Kermit sends each file, it also sends certain information about the file
  1167. in an "attribute packet", provided the other Kermit agrees to accept attribute
  1168. packets.  This information includes the size, type (text or binary, determined
  1169. from the "-i" command-line option or the "set file type" command), creation
  1170. date, and a code to let the other Kermit know that the file is being sent from
  1171. a UNIX system.  The other Kermit may accept or refuse the file based upon these
  1172. attributes, for example, if it doesn't have enough disk space to store a file
  1173. of the specified size.
  1174.  
  1175. The file type attribute allows C-Kermit, when sending a file, to tell the
  1176. receiving whether it should be in text or binary mode.  Therefore, if the
  1177. receiving Kermit has this feature, it is not necessay to give it a SET FILE
  1178. TYPE command to "match modes" with C-Kermit.
  1179.  
  1180. Note -- C-Kermit sends only from the current or specified directory.  It does
  1181. not traverse directory trees.  If the source directory contains subdirectories,
  1182. they will be skipped.  By the same token, C-Kermit does not create directories
  1183. when receiving files.  If you have a need to do this, you can pipe tar through
  1184. C-Kermit, as shown in the example in section 1.15, or under AT&T System III/V
  1185. UNIX you can use cpio, or BACKUP under VAX/VMS, etc.
  1186.  
  1187. Another Note -- The SEND command skips over "invisible" files that match the
  1188. file specification; UNIX systems usually treat files whose names start with a
  1189. dot (like .login, .cshrc, and .kermrc) as invisible.  If you want to send
  1190. these, include the dot in your filespec, as in:
  1191.  
  1192.     send .*
  1193.  
  1194.  
  1195. The RECEIVE Command
  1196.  
  1197. Syntax:  RECEIVE [fn1]
  1198.  
  1199. Passively wait for files to arrive from the other Kermit, which must be given
  1200. the SEND command -- the RECEIVE command does not work in conjunction with a
  1201. server (use GET for that).  If fn1 is specified, store the first incoming file
  1202. under that name.  The RECEIVE command may be abbreviated to R.
  1203.  
  1204. Incoming file data is normally decoded and stored according to whether C-Kermit
  1205. is in text or binary mode.  But if the other Kermit sends the file-type
  1206. attribute, this will override C-Kermit's file-type setting on a per-file basis.
  1207. Therefore, it is possible for another Kermit program to send C-Kermit a mixture
  1208. of text and binary files, so long as the type of each file is indicated in the
  1209. Attribute packet.  For text files, C-Kermit will perform character-set
  1210. translation if a known transfer character set is indicated in the Attribute
  1211. packet (see section on International Characters).
  1212.  
  1213. C-Kermit also attempts to store the incoming file with the creation date that
  1214. is specified in the Attribute packet.  C-Kermit does not attempt to verify disk
  1215. space against the announced size of the incoming file.
  1216.  
  1217. You can control C-Kermit's use of these attributes using the SET ATTRIBUTE
  1218. command.
  1219.  
  1220.  
  1221. The STATISTICS Command
  1222.  
  1223. The STATISTICS command displays information about the most recent Kermit file
  1224. transfer or other protocol transaction, including file and communication line
  1225. input and output, timing and efficiency, as well as what encoding options were
  1226. in effect (such as 8th-bit prefixing, repeat-count compression, packet lengths,
  1227. window size).
  1228.  
  1229.  
  1230. Non-Protocol Data Transfers
  1231.  
  1232. It is also possible to transfer files with other computers that do not have a
  1233. Kermit program available.  To send a file to such a computer, use the TRANSMIT
  1234. command:
  1235.  
  1236. Syntax: TRANSMIT fn1
  1237.  
  1238. This command sends the named file without error checking, obeying current
  1239. settings for file type (text or binary), parity, and duplex.
  1240.  
  1241. In text mode, send the file a line at a time, with character translations done
  1242. according to the current file and transfer character sets, using the SET
  1243. TRANSMIT PROMPT character (linefeed, \10, by default) as a line turnaround
  1244. character.  That is, send a line from the file, wait until the prompt character
  1245. comes in response, then send the next line, and so on.  If zero (0) is
  1246. specified for the prompt character, then send the whole file without waiting
  1247. for any response or echo from the host.  Don't try this unless you know that
  1248. the host can successfully process long continuous bursts of input characters.
  1249. Each line is terminated by a carriage return, just as you would type it at a
  1250. terminal.  Linefeeds are stripped unless you have given the command SET
  1251. TRANSMIT LINEFEED ON.  The computer to which you are transmitting the file
  1252. should be prepared to receive it, for instance into a text editor.
  1253.  
  1254. In binary mode, send all the characters of the file with no modification and no
  1255. line turnaround handshake (the TRANSMIT PROMPT setting is ignored).  Use binary
  1256. mode only if you know that the computer or device to which you are transmitting
  1257. the file can receive arbitrary patterns of characters at full speed.
  1258.  
  1259. If you want to transmit 8-bit data over a 7-bit connection (i.e. PARITY is not
  1260. NONE), you can use SET TRANSMIT LOCKING-SHIFT ON to have Kermit send SO/SI
  1261. shifts around your 8-bit characters.  The TRANSMIT command can be interrupted
  1262. by typing Ctrl-C.  Also see SET TRANSMIT.
  1263.  
  1264. The opposite of TRANSMIT is LOG SESSION, which lets you capture files or screen
  1265. data from remote computers during CONNECT, also without error checking.
  1266.  
  1267. XMIT may be used as a synonym for TRANSMIT in the TRANSMIT, SET TRANSMIT, and
  1268. SHOW TRANSMIT commands.
  1269.  
  1270.  
  1271. 1.7. Being and Using a Kermit Server
  1272.  
  1273. The SERVER command places C-Kermit in "server mode" on the currently selected
  1274. communication device or network connection.  All further commands must arrive
  1275. as valid Kermit packets from the Kermit on the other end of the line.  If you
  1276. are running C-Kermit on the remote computer, then you should escape back to
  1277. your local computer after you give C-Kermit the SERVER command, and then issue
  1278. all further commands to the C-Kermit server from your local Kermit's command
  1279. prompt.  It is also possible to work the other way: your local computer is the
  1280. Kermit server and the remote computer issues the commands -- this can only work
  1281. if the remote Kermit is driven by a TAKE command file (which should end with
  1282. the command FINISH).
  1283.  
  1284. The C-Kermit server can respond to the following commands from the client:
  1285.  
  1286.   Client Command         Server Response
  1287.     GET                    Sends files
  1288.     SEND                   Receives files
  1289.     MAIL                   Sends incoming files as e-mail to specified address
  1290.     BYE                    Attempts to log itself out
  1291.     FINISH                 Exits to level from which it was invoked
  1292.     REMOTE CD              Changes working directory (also, remote cd)
  1293.     REMOTE DIRECTORY       Sends directory listing
  1294.     REMOTE DELETE          Removes files
  1295.     REMOTE HELP            Lists these capabilities
  1296.     REMOTE HOST            Executes a UNIX shell command
  1297.     REMOTE KERMIT          Sends a Kermit command to a Kermit server
  1298.     REMOTE LOGIN           Login to a Kermit server that requires this
  1299.     REMOTE LOGOUT          Logout from a Kermit server
  1300.     REMOTE PRINT           Receives a file and prints it
  1301.     REMOTE SET             Changes its settings
  1302.     REMOTE SPACE           Reports about its disk usage
  1303.     REMOTE TYPE            Sends files to your screen
  1304.     REMOTE WHO             Shows who's logged in
  1305.  
  1306. If the Kermit server is directed at an external line (i.e. it is in "local
  1307. mode") then the console may be used for other work if you SET FILE DISPLAY OFF
  1308. and run it in the background; normally the program expects the console to be
  1309. used to observe file transfers and enter status queries or to interrupt
  1310. commands.  The way to get C-Kermit into background operation from interactive
  1311. command level varies from system to system (e.g. on Berkeley UNIX you would
  1312. halt the program with ^Z and then use the C-Shell 'bg' command to continue it
  1313. in the background).  The more common method is to invoke the program with the
  1314. desired command line arguments, including "-q", and with a terminating "&".
  1315.  
  1316. The C-Kermit server will accept a list of files in GET commands sent by the
  1317. client, similar to the list you can give to the MSEND command, e.g.:
  1318.  
  1319.     MS-Kermit>get ~joe/new.txt /etc/termcap ../*.c
  1320.  
  1321. The file specifications are separated by spaces.  If you need to include a
  1322. space in a filename, quote it with a backslash, for example:
  1323.  
  1324.     MS-Kermit>get node"user\ passwd"::dev:[dir]name.ext
  1325.  
  1326. If you need to include a backslash, use two of them.
  1327.  
  1328. When the UNIX Kermit server is given a REMOTE HOST command, it executes it
  1329. using the shell invoked upon login, e.g. the Bourne shell, the Korn Shell, or
  1330. the Berkeley C-Shell (or whatever the user has set her SHELL environment
  1331. variable to be).
  1332.  
  1333. The server can issue periodic NAK packets.  You can control the rate at which
  1334. this happens via SET SERVER TIMEOUT.  Specifiying a value of zero instructs
  1335. C-Kermit not to do this at all.  A nonzero value, n, makes a NAK appear every n
  1336. seconds during server command wait.  This is useful if the client Kermit is not
  1337. capable of timeouts, and a packet that it sends to the server is lost.  The
  1338. default server timeout is zero.
  1339.  
  1340. SECURITY.  Before putting C-Kermit into server mode, you can give it commands
  1341. to restrict the types of access it allows to clients.  The command is DISABLE.
  1342. You can turn these accesses back on using the ENABLE command.  Here are the
  1343. items that can be controlled in this way, with the effect of DISABLE noted.
  1344. CAUTION: If you leave HOST enabled, the client can get around some of these
  1345. restrictions with REMOTE HOST commands.
  1346.  
  1347. BYE             Ignore BYE commands from the client, stay in server mode.
  1348. CD              Don't let the client change directories, or send files to, or
  1349.                 get files from, or delete or type files in, any but the current
  1350.                 directory, nor inquire about space in any but the current
  1351.                 directory.
  1352. DELETE          Don't let the client delete any files.
  1353. DIRECTORY       Don't let the client request a directory listing.
  1354. FINISH          Ignore FINISH commands from the client, stay in server mode.
  1355. GET             Don't let the client GET files.
  1356. HOST            Ignore REMOTE HOST commands from the client.
  1357. SEND            Don't accept files that the client tries to send.
  1358. SET             Refuse REMOTE SET commands from the client.
  1359. SPACE           Refuse REMOTE SPACE commands from the client.
  1360. TYPE            Refuse REMOTE TYPE commands from the client.
  1361. WHO             Refuse REMOTE WHO commands from the client.
  1362. ALL             All of the above.
  1363.  
  1364.  
  1365. Using a Kermit Server
  1366.  
  1367. C-Kermit may itself request services from a remote Kermit server.  To send a
  1368. file to a Kermit server, use the SEND command, just as you would to send a file
  1369. to a Kermit program that has been given the RECEIVE command.  But you cannot
  1370. use the RECEIVE command to get a file from a Kermit server, because the RECEIVE
  1371. command just waits passively for a file to arrive, but the server has not been
  1372. told which file to send.  For this, you need the GET command:
  1373.  
  1374. Syntax:  GET rfn
  1375.  
  1376.         or: GET
  1377.                 rfn
  1378.                 fn1
  1379.  
  1380. The GET command requests a remote Kermit server to send the named file or
  1381. files, it must be used in place of RECEIVE.  Since a remote file specification
  1382. (or list) might contain spaces, which normally delimit fields of a C-Kermit
  1383. command, an alternate form of the command is provided to allow the inbound file
  1384. to be given a new name: type GET alone on a line, and you will be prompted
  1385. separately for the remote and local file specifications, for example:
  1386.  
  1387.     C-Kermit>get
  1388.      Remote file specification: profile exec
  1389.      Local name to store it under: profile.exec
  1390.  
  1391. If a `?' is to be included in the remote file specification, you must prefix it
  1392. with `\' to suppress its normal function of providing help.
  1393.  
  1394. If you have started a multiline GET command, you may escape from its lower-
  1395. level prompts by typing a carriage return in response to the prompt, e.g.
  1396.  
  1397.     C-Kermit>get
  1398.      Remote file specification: foo
  1399.      Local name to store it under: (Type a carriage return here)
  1400.     (cancelled)
  1401.     C-Kermit>
  1402.  
  1403. After the GET command has been entered, the file transfer proceeds exactly as
  1404. if you had given a SEND command to the other Kermit and a RECEIVE command to
  1405. this one.
  1406.  
  1407. In addition to SEND and GET, the following commands may also be sent from
  1408. C-Kermit to a Kermit server.  If the server does not support a command that you
  1409. send to it, it will respond with a message like "Unknown server command" or
  1410. "Unimplemented REMOTE command".
  1411.  
  1412.     REMOTE CD [directory]
  1413.         Request the server to change its default directory (and/or device) to
  1414.         the one you specify.  If none is specified, the server is requested to
  1415.         return to its primary default directory (normally the login directory).
  1416.  
  1417.  
  1418.     REMOTE DELETE rfn
  1419.         The server is requested to delete the specified file or files.
  1420.  
  1421.  
  1422.     REMOTE DIRECTORY [rfn]
  1423.         The server is requested to send a directory listing of the specifed
  1424.         files.  If no files are specified, then the server should send a
  1425.         listing of all the files in the current directory.
  1426.  
  1427.  
  1428.     REMOTE HELP
  1429.         The server is requested to send to your screen a list of the commands
  1430.         that you may issue to it from your local Kermit.
  1431.  
  1432.  
  1433.     REMOTE HOST command
  1434.         The server is requested to ask its host operating system to execute the
  1435.         given command.
  1436.  
  1437.  
  1438.     REMOTE KERMIT command
  1439.         The remote server is requested to execute the given command, which is
  1440.         in its own (Kermit program) syntax.
  1441.  
  1442.  
  1443.     REMOTE LOGIN userid password [account]
  1444.         If a remote Kermit server has been set up to require to provide a user
  1445.         ID and password before you can gain access to it, use this command to
  1446.         send it the user ID and password.
  1447.  
  1448.  
  1449.     REMOTE LOGOUT
  1450.         Remove your access from a remote Kermit server that you have REMOTE
  1451.         LOGIN'ed to.
  1452.  
  1453.  
  1454.     REMOTE PRINT file [options]
  1455.         The file is sent to the server, which is requested via Attribute packet
  1456.         to print it on its printer using the specified print options.
  1457.  
  1458.  
  1459.     REMOTE SET parameter value
  1460.         The server is requested to set the given parameter to the specified
  1461.         value.  Use question mark to find out what parameters and values are
  1462.         available.  The meanings of these parameters and values are explained
  1463.         in the section on the SET command, below.  Perhaps the most useful one
  1464.         is REMOTE SET FILE TYPE { TEXT, BINARY }.
  1465.  
  1466.  
  1467.     REMOTE SPACE [dir]
  1468.         The server is requested to report on available disk space in the
  1469.         specified device and/or directory, or in the current area if none
  1470.         specified.
  1471.  
  1472.  
  1473.     REMOTE TYPE [rfn]
  1474.         The server is requested to send the specified file for display on your
  1475.         screen.
  1476.  
  1477.  
  1478.     REMOTE WHO [user]
  1479.         The server is requested to send a list of the users who are logged in
  1480.         on its computer.  If a username is given, information about that user
  1481.         is requested.
  1482.  
  1483.  
  1484.     BYE and FINISH:
  1485.         When connected to a remote Kermit server, these commands cause the
  1486.         remote server to terminate; FINISH returns it to Kermit or system
  1487.         command level (depending on the implementation or how the program was
  1488.         invoked); BYE also requests it to log itself out.
  1489.  
  1490.  
  1491. 1.8. International Character Sets
  1492.  
  1493. Text files may be written in languages other than English, and in most cases
  1494. that means that they contain non-ASCII characters such as accented letters,
  1495. special punctuation marks, etc.  Many different character sets have been
  1496. devised to represent different languages.  These character sets are sometimes
  1497. specific to a particular computer manufacturer, and sometimes they conform to
  1498. one standard or another.  The Kermit file transfer protocol permits Kermit
  1499. programs to exchange files written in different character sets by translating
  1500. between each computer's local file character set and a standard set that is
  1501. used "on the wire".  Here are the relevant commands:
  1502.  
  1503.     SET FILE TYPE TEXT
  1504.         Character set translation is not done at all unless the file type is
  1505.         text.
  1506.  
  1507.  
  1508.     SET TRANSFER CHARACTER-SET name
  1509.         Tell C-Kermit which character set is to be used on the wire, i.e.
  1510.         within the Kermit packets.  The choices are TRANSPARENT (no
  1511.         translation, this is the default), ASCII (translate to/from US ASCII),
  1512.         LATIN1 (ISO 8859-1 Latin Alphabet 1), CYRILLIC-ISO (ISO 8859-5
  1513.         Latin/Cyrillic Alphabet), and JAPANESE-EUC.  Synonym: SET XFER
  1514.         CHARACTER-SET.
  1515.  
  1516.  
  1517.     SET FILE CHARACTER-SET name
  1518.         Tell C-Kermit which character set is used in the local file, ASCII, or
  1519.         any of a dozen or so 7-bit national replacement character sets (NRCs)
  1520.         such as ITALIAN, NORWEGIAN, etc, or an 8-bit character set like LATIN1,
  1521.         DEC-Multinational, DG-International, NEXT (for NeXT workstations),
  1522.         CP437 or CP850 (for IBM or Xenix systems), APPLE (for A/UX on the
  1523.         Macintosh); CP866, KOI8-CYRILLIC, CYRILLIC-ISO, and SHORT-KOI for
  1524.         Cyrillic; and JAPANESE-EUC, DEC-KANJI, SHIFT-JIS, and JIS7 for Japanese
  1525.         Kanji.
  1526.  
  1527.  
  1528.     SET LANGUAGE name
  1529.         Enable certain language-specific translations, especially for DUTCH,
  1530.         ICELANDIC, GERMAN, RUSSIAN, and the Scandinavian languages.  In
  1531.         particular, SET LANGUAGE RUSSIAN makes Kermit treat ASCII as if it were
  1532.         SHORT-KOI when it is a FILE or TRANSFER character set, and the
  1533.         corresponding TRANSFER or FILE character set is an 8-bit Cyrillic set.
  1534.  
  1535.  
  1536.     TRANSLATE file1 cs1 cs2 [ file2 ]
  1537.         Translate the local file file1 from the character set cs1 into the
  1538.         character set cs2.  Both character sets may be selected from C-Kermit's
  1539.         repertoire of file character sets.  The result is stored in file2 or
  1540.         (if file2 is not specified), displayed on the screen.  If LANGUAGE is
  1541.         set to RUSSIAN, ISO Latin-Cyrillic is used as the intermediate standard
  1542.         character set during translation, otherwise ISO Latin Alphabet 1 is
  1543.         used.  Does not yet work for Kanji.
  1544.  
  1545. The SET commands are described in more detail later.
  1546.  
  1547. When sending a file, C-Kermit translates the file from the specified file
  1548. character set into the specified transfer character set, and an identifier for
  1549. the selected transfer character set is included in the file attribute packet,
  1550. if use of attribute packets has been negotiated and a SET ATTR [CHARACTER-SET]
  1551. OFF command has not been given.
  1552.  
  1553. When receiving, C-Kermit translates from the specified transfer character set
  1554. to the specified file character set or, if a transfer character set is
  1555. identified in the incoming attribute packet it is used instead.  If the file
  1556. character set is ASCII and special characters are being received, then they are
  1557. translated by stripping diacritical marks and aiming for the closest possible
  1558. 1-to-1 translation on a per-character basis.  But if a SET LANGUAGE command has
  1559. been given, special translations can be done.  For example if LANGUAGE has been
  1560. set to GERMAN and the local file character set is ASCII, and a file arrives
  1561. with a transfer character set of LATIN1, then C-Kermit will translate German
  1562. umlaut-vowels into the corresponding vowels followed by the letter e, and
  1563. German double-s into two s's.  Similar translations take effect for other
  1564. languages.
  1565.  
  1566. If unwanted effects appear because of Kermit's translation, you can disable
  1567. this feature with SET ATTRIBUTE CHARACTER-SET OFF.
  1568.  
  1569. When transferring text that contains long runs of 8-bit data over a 7-bit
  1570. communication channel, efficiency can be improved with the following command:
  1571.  
  1572.     SET TRANSFER LOCKING-SHIFT { OFF, ON, FORCED }
  1573.         Specifies whether locking shifts should be used by Kermit when encoding
  1574.         and decoding packets.  A locking shift is a special character, Ctrl-N
  1575.         (Shift-Out, SO), that means that all the following characters, up to
  1576.         the next Ctrl-O (Shift-In, SI), are to have their 8th bits set to 1
  1577.         upon receipt.  For long runs of 8-bit characters, this is more
  1578.         efficient than Kermit's regular "single shift" method of prefixing each
  1579.         8-bit character by an &-sign.  Synonym: SET XFER LOCKING-SHIFT.  The
  1580.         options are:
  1581.  
  1582.         ON  This is the default setting.  If PARITY is not NONE, try to
  1583.             negotiate the use of locking shift protocol with the other Kermit,
  1584.             and use it if the other Kermit agrees.  If PARITY is NONE, locking
  1585.             shifts won't be used.
  1586.  
  1587.  
  1588.         OFF Don't use locking shifts.
  1589.  
  1590.  
  1591.         FORCED
  1592.             Use locking shifts, regardless of the parity setting and
  1593.             negotiations.  Automatically disables the use of 8th-bit prefixing
  1594.             (single shifts).  For the file sender, this command lets data be
  1595.             sent to the receiver with embedded SO and SI characters, which can
  1596.             be processed properly by many terminals, printers, and other
  1597.             devices.  For the file receiver, this command forces the treatment
  1598.             of SO and SI characters in the data as shift commands.
  1599.  
  1600. Locking shifts are most effective for text written in non-Roman alphabets and
  1601. encoded in standard 8-bit character sets like ISO Latin/Cyrillic, ISO
  1602. Latin/Arabic, ISO Latin/Hebrew, ISO Latin/Greek, or Japanese EUC.
  1603. Locking-shift status is displayed by the SHOW and STATISTICS commands.
  1604.  
  1605.  
  1606. 1.9. Logging Things
  1607.  
  1608. Kermit's actions during terminal connection and file transfer can be logged in
  1609. several ways, using the LOG command:
  1610.  
  1611. Syntax: LOG {DEBUGGING, PACKETS, SESSION, TRANSACTIONS} [ fn1 [
  1612.  { APPEND, NEW }=NEW ] ]
  1613.  
  1614. C-Kermit's progress may be logged in various ways.  The LOG command opens a
  1615. log, the CLOSE command closes it.  In addition, all open logs are closed by the
  1616. EXIT and QUIT commands.  A name may be specified for a log file; if the name is
  1617. omitted, the file is created with a default name as shown below.  If the
  1618. keyword APPEND is included at the end of the command, then if the specified
  1619. file exists, it is appended to rather than written over; if it does not exist,
  1620. a new file is created.
  1621.  
  1622. LOG DEBUGGING
  1623.     This produces a voluminous log of the internal workings of C-Kermit, of use
  1624.     to Kermit developers or maintainers in tracking down suspected bugs in the
  1625.     C-Kermit program.  Use of this feature slows down the Kermit protocol and
  1626.     fills up your disk.  Default name: debug.log.
  1627.  
  1628.  
  1629. LOG PACKETS
  1630.     This produces a record of all the packets that go in and out of the
  1631.     communication port.  This log is of use to Kermit maintainers who are
  1632.     tracking down protocol problems in either C-Kermit or any Kermit that
  1633.     C-Kermit is connected to.  Default name:  packet.log.
  1634.  
  1635.  
  1636. LOG SESSION
  1637.     This log will contain a copy of everything you see on your screen during
  1638.     the CONNECT command, except for local messages or interaction with local
  1639.     escape commands.  Default name:  session.log.
  1640.  
  1641.  
  1642. LOG TRANSACTIONS
  1643.     The transaction log is a record of all the files that were sent or received
  1644.     while transaction logging was in effect.  It includes time stamps and
  1645.     statistics, filename transformations, and records of any errors that may
  1646.     have occurred.  The transaction log allows you to have long unattended file
  1647.     transfer sessions without fear of missing some vital screen message.
  1648.     Default name:  transact.log.
  1649.  
  1650. The CLOSE command closes the named log, e.g. CLOSE DEBUG, CLOSE SESSION.
  1651.  
  1652. Note:  Debug and Transaction logs are a compile-time option; C-Kermit may be
  1653. compiled without these logs, in which case it will run faster, it will take up
  1654. less space on the disk, but the commands relating to them will not be present.
  1655.  
  1656.  
  1657. 1.10. Local File Management
  1658.  
  1659. C-Kermit allows the following local file management functions from its
  1660. interactive command level:
  1661.  
  1662. CD [directory-name]
  1663.     Changes Kermit's working device and/or directory to the one given, or to
  1664.     the user's default directory and/or device if the name is omitted.  This
  1665.     command affects only the Kermit process and any processes it may
  1666.     subsequently create.  You may use CWD and SET DEFAULT as synonyms for CD.
  1667.  
  1668. DELETE fn
  1669.     Deletes (removes, erases) file fn, which may be the name of a single file
  1670.     or a wildcard specification containing * and/or ?  characters.  You may use
  1671.     RM as a synonym for DELETE.
  1672.  
  1673. DIRECTORY [fn]
  1674.     Displays a listing of the files whose names match fn, which may be the name
  1675.     of a single file or a wildcard specification containing * and/or ?
  1676.     characters.  If no fn is given, C-Kermit lists all files in the current
  1677.     device and/or directory.  The format of and information provided in the
  1678.     listing depends on the operating system.  You may use LS as a synonym for
  1679.     DIRECTORY.
  1680.  
  1681. PWD (Print Working Directory) Display the current working (default) file device
  1682.     and/or directory.  You may use SHOW DEFAULT as a synonym for PWD.
  1683.  
  1684. PRINT fn1 [ options ]
  1685.     Print the local file fn1 on a local printer.  Options can be included after
  1686.     the filename, for example, to select a particular printer.  The options are
  1687.     in the format of the local system's printing command.
  1688.  
  1689. RENAME fn1 fn2
  1690.     Changes the name of file fn1 to fn2.  You may use MV as a synonym for
  1691.     RENAME.
  1692.  
  1693. SPACE
  1694.     Displays information about disk space and/or quota in the current directory
  1695.     and device.
  1696.  
  1697. TYPE fn
  1698.     Display the named file on the screen.  May be interrupted with Ctrl-C, and
  1699.     on most systems the display can be stopped and resumed with Ctrl-S and
  1700.     Ctrl-Q, respectively.  You may use CAT as a synonym for TYPE.
  1701.  
  1702. { @, !, RUN, PUSH }
  1703.     The command is executed by your computer's operating system command
  1704.     interpreter (UNIX shell, VMS DCL, etc).  If no command is specified, then
  1705.     an interactive session is started; exiting from this session, e.g. by
  1706.     typing Control-D or 'exit' to a UNIX shell, or LOGOUT to VMS DCL, will
  1707.     return you to C-Kermit command level.  Use the `!' command to provide file
  1708.     management or other functions not explicitly provided by C-Kermit commands.
  1709.     !, @, RUN, and PUSH are all synonyms for the same command.
  1710.  
  1711.  
  1712. 1.11. The SET and SHOW Commands
  1713.  
  1714. Since Kermit is designed to allow diverse computers to communicate, it is often
  1715. necessary to issue special instructions to allow Kermit to adapt to
  1716. peculiarities of the other computer or the communication path.  These
  1717. instructions are accomplished by the SET command.  The following parameters may
  1718. be SET:
  1719.  
  1720.      ATTRIBUTES  Turn Attribute packet processing on or off.
  1721.      BACKGROUND  Force foreground or background mode.
  1722.     BLOCK-CHECK  Level of packet error detection.
  1723.         BUFFERS  Send and receive packet buffer sizes.
  1724.         CARRIER  Treatment of carrier on terminal connections.
  1725.            CASE  Controls treatment of alphabetic case.
  1726.         COMMAND  Character set size for commands.
  1727.           COUNT  For counted loops.
  1728.           DEBUG  Log or display debugging information.
  1729.         DEFAULT  Default directory.
  1730.           DELAY  How long to wait before sending first packet.
  1731.            DIAL  Parameters for DIAL command.
  1732.          DUPLEX  Specify which side echoes during CONNECT.
  1733.          ESCAPE  Prefix for "escape commands" during CONNECT.
  1734.            FILE  Set various file parameters.
  1735.    FLOW-CONTROL  Communication line full-duplex flow control.
  1736.       HANDSHAKE  Communication line half-duplex turnaround character.
  1737.            HOST  Specify network host name.
  1738.      INCOMPLETE  Disposition for incompletely received files.
  1739.           INPUT  Control behavior of INPUT command.
  1740.        LANGUAGE  Enable language-specific character-set translations.
  1741.            LINE  Communication line device name.
  1742.           MACRO  Control aspects of macro execution.
  1743.    MODEM-DIALER  Type of modem-dialer on communication line.
  1744.             PAD  (X.25 systems only) X.3 PAD parameters.
  1745.          PARITY  Communication line character parity.
  1746.          PROMPT  The C-Kermit program's interactive command prompt.
  1747.         RECEIVE  Parameters for inbound packets.
  1748.           RETRY  Packet retransmission limit.
  1749.          SCRIPT  Parameters for the SCRIPT command.
  1750.            SEND  Parameters for outbound packets.
  1751.          SERVER  Parameters for server operation.
  1752.     SESSION-LOG  (UNIX only) Session log file type, text or binary.
  1753.           SPEED  Communication line speed.
  1754.         SUSPEND  Enable/Disable SUSPEND.
  1755.            TAKE  Control aspects of TAKE file execution.
  1756.        TERMINAL  Terminal parameters.
  1757.        TRANSFER  File transfer parameters.
  1758.        TRANSMIT  Control aspects of TRANSMIT command execution.
  1759.         UNKNOWN  Specify handling of unknown character sets.
  1760.          WINDOW  File transfer packet window size.
  1761.        WILDCARD  (UNIX only) Kermit vs shell wildcard expansion.
  1762.            X.25  (X.25 systems only) X.25 call parameters
  1763.  
  1764. The SHOW command may be used to display current settings.  Here is a summary of
  1765. settings available in C-Kermit, listed alphabetically.
  1766.  
  1767. SET ATTRIBUTES
  1768.     Tells C-Kermit whether to exchange file attribute (A) packets, or whether
  1769.     to include specified attributes within the A packets it sends, or whether
  1770.     to pay attention to specific attributes in A packets it receives.  When the
  1771.     use of A packets has been negotiated, C-Kermit enables and uses the ones
  1772.     listed below.  When sending files, C-Kermit responds to an Attribute
  1773.     refusal from the other computer by not sending the specified file.  For
  1774.     example, if C-Kermit announces in the A packet that the file is 100K long,
  1775.     the other Kermit could refuse the file because of insufficient disk space,
  1776.     and then C-Kermit would not send it.
  1777.  
  1778.     SET ATTRIBUTE CHARACTER-SET { ON, OFF }
  1779.         Turn the character-set attribute ON or OFF.  If ON, C-Kermit includes a
  1780.         code for the transfer character set in the A packet when sending a
  1781.         file, and when receiving a file, C-Kermit will translate from the
  1782.         character set (if any) specified in the incoming A packet into the
  1783.         current file character set (see SET FILE), if the transfer character
  1784.         set is known to C-Kermit (see SET UNKNOWN).
  1785.  
  1786.  
  1787.     SET ATTRIBUTE DATE { ON, OFF }
  1788.         If ON, C-Kermit includes the file's creation date in the A packet when
  1789.         sending a file, and stores incoming files with the creation dates (if
  1790.         any) given in the incoming A packets.  Beware: on some computers,
  1791.         incremental backups might skip over files with creation dates older
  1792.         than the most recent backup.
  1793.  
  1794.  
  1795.     SET ATTRIBUTE DISPOSITION { ON, OFF }
  1796.         The MAIL and REMOTE PRINT commands work by setting "dispositions" of
  1797.         Mail and Print in the A packet when sending a file.  SET ATTR DISP OFF
  1798.         will cause C-Kermit to ignore this and store such files on disk rather
  1799.         than mailing or printing them.
  1800.  
  1801.  
  1802.     SET ATTRIBUTE LENGTH { ON, OFF }
  1803.         When sending files, C-Kermit puts their length in the A packet, so the
  1804.         receiving system has an opportunity to check and/or allocate disk space
  1805.         in advance, and to refuse the file if there is not enough disk space.
  1806.         If you believe that files are being unjustly refused on the basis of
  1807.         length, you can SET ATTR LENGTH OFF.  When receiving files, C-Kermit
  1808.         presently ignores the length announced in the A packet.
  1809.  
  1810.  
  1811.     SET ATTRIBUTE OS-SPECIFIC { ON, OFF }
  1812.         Certain versions of Kermit convey operating-system specific file
  1813.         information in the A packet, which is primarily useful when
  1814.         transferring files between like systems, such as VMS to VMS.  If you
  1815.         find this feature is interfering with successful file transfer, SET
  1816.         ATTR OS OFF.
  1817.  
  1818.  
  1819.     SET ATTRIBUTE SYSTEM-ID { ON, OFF }
  1820.         The A packet also includes a code identifying the file's operating
  1821.         system of origin, so that the receiver of the file can decide whether
  1822.         to pay attention to the OS-SPECIFIC attribute.  Use SET ATTR SYS OFF to
  1823.         disable this feature.
  1824.  
  1825.  
  1826.     SET ATTRIBUTES ALL { ON, OFF }
  1827.         You can turn all the above off using SET ATTR ALL OFF, and back on
  1828.         using SET ATTR ALL ON.
  1829.  
  1830.  
  1831.     SET ATTRIBUTES { ON, OFF }
  1832.         This command turns the attribute mechanism itself on or off, without
  1833.         disturbing the settings of the individual attributes.  It is on by
  1834.         default.
  1835.  
  1836.  
  1837.  
  1838. SET BACKGROUND { OFF, ON }
  1839.     Use SET BACKGROUND off to make your prompts and messages appear in case
  1840.     they have disappeared because Kermit thinks it is running in the background
  1841.     (for example, if you are running it through an output filter, as in "kermit
  1842.     | vt100").  You can accomplish the same effect using the -z option on the
  1843.     command line.
  1844.  
  1845.  
  1846. SET BLOCK-CHECK {1, 2, 3}
  1847.     Determines the level of per-packet error detection.  "1" is a single-
  1848.     character 6-bit checksum, folded to include the values of all bits from
  1849.     each character.  "2" is a 2-character, 12-bit checksum.  "3" is a
  1850.     3-character, 16-bit cyclic redundancy check (CRC).  The higher the block
  1851.     check, the better the error detection and correction and the higher the
  1852.     resulting overhead.  Type 1 is most commonly used; it is supported by all
  1853.     Kermit implementations, and it has proven adequate in most circumstances.
  1854.     Types 2 or 3 should be used when transferring 8-bit data or when using long
  1855.     packets.
  1856.  
  1857.  
  1858. SET BUFFERS n1 n2
  1859.     Allows you to change the total buffer space used for sending packets (n1)
  1860.     and receiving packets (n2), if Kermit has been configured to allow dynamic
  1861.     buffer allocation.  The bigger you make them, the longer your packets can
  1862.     be, and the more window slots you can use.  To see the default values for
  1863.     your version of Kermit, type SHOW PROTOCOL.
  1864.  
  1865.  
  1866. SET CARRIER {AUTO, ON [n], OFF}
  1867.     Specifies C-Kermit's treatment of the Carrier (CD, DCD, or RLSD) RS-232
  1868.     signal on terminal device connections obtained via SET LINE:
  1869.  
  1870.     SET CARRIER ON
  1871.         Means to require carrier at all times; SET LINE will not return until
  1872.         carrier appears (handy for setting Kermit up to wait for a call to come
  1873.         in), and a fatal error will occur if carrier disappears during CONNECT
  1874.         or file transfer.  A nice side effect is that when you log out from the
  1875.         remote computer, you will be put back at C-Kermit prompt level
  1876.         automatically if the remote system drops carrier properly.  If you want
  1877.         to set a time limit on how long SET LINE will wait for carrier, you can
  1878.         include an optional number after SET CARRIER ON to specify the number
  1879.         of seconds to wait before timing out and returning to the prompt, for
  1880.         example SET CARRIER ON 30.
  1881.  
  1882.  
  1883.     SET CARRIER OFF means to ignore carrier at all times.  Useful for direct,
  1884.         nonmodem connections, or misbehaving modem connections.  Should only be
  1885.         used when necessary, because it takes away the ability of Kermit to
  1886.         automatically detect a broken phone connection.
  1887.  
  1888.  
  1889.     SET CARRIER AUTO means to require carrier during CONNECT but not at other
  1890.         times.  AUTO is the default.  SET CARRIER ON does not affect the DIAL
  1891.         command.
  1892.  
  1893.  
  1894.  
  1895. SET CASE { ON, OFF }
  1896.     Tells C-Kermit whether to pay attention to or ignore alphabetic case in
  1897.     string matching operations, including INPUT and IF.  Default is OFF, i.e.
  1898.     ignore case.
  1899.  
  1900.  
  1901. SET COMMAND BYTESIZE { 7, 8 }
  1902.     Normally, C-Kermit's command processor strips off the 8th bit of any
  1903.     character you type, in case your data connection to C-Kermit has parity.
  1904.     If there is no parity and you want to use an 8-bit international character
  1905.     set in your commands (for example, in the ECHO command, or in filenames),
  1906.     use SET COMMAND BYTESIZE 8.  The command also applies to the connection
  1907.     between your terminal (if any) and C-Kermit during terminal emulation
  1908.     (CONNECT), as opposed to the connection between C-Kermit and the remote
  1909.     host (see SET TERMINAL BYTESIZE).
  1910.  
  1911.  
  1912. SET COUNT n
  1913.     For use with counted loops.  See the section on script language
  1914.     programming.
  1915.  
  1916.  
  1917. SET DEFAULT directory
  1918.     Change default directory.  Equivalent to CD.
  1919.  
  1920.  
  1921. SET DIAL DISPLAY { ON, OFF }
  1922.     Show dialing activity on screen.
  1923.  
  1924.  
  1925. SET DIAL HANGUP { ON, OFF }
  1926.     Normally, the DIAL command will attempt to hang up the phone before dialing
  1927.     a new call.  This is done by momentarily dropping the Data Terminal Ready
  1928.     (DTR) signal on the currently selected terminal device.  Unfortunately, the
  1929.     method for doing this is ill-defined in some versions of UNIX, and in some
  1930.     cases DTR goes down and stays down, which can prevent all further
  1931.     communication between the computer and the modem.  If you find that the
  1932.     DIAL command does not work for you at all, try giving the command SET DIAL
  1933.     HANGUP OFF before giving the DIAL command.  This will prevent DIAL from
  1934.     hanging up the phone before dialing the new call.
  1935.  
  1936.  
  1937. SET DIAL INIT-STRING string
  1938.     Replace Kermit's built-in initialization string with string, which may
  1939.     contain backslash codes to represent control characters.
  1940.  
  1941.  
  1942. SET DIAL MNP-ENABLE { ON, OFF }
  1943.     Enable or disable MNP protocol negotiations by the modem.  Normally off.
  1944.     This command presently applies only to Telebit modems.
  1945.  
  1946.  
  1947. SET DIAL KERMIT-SPOOF { OFF, ON }
  1948.     Enable modem's "Kermit spoof" if it has one.
  1949.  
  1950.  
  1951. SET DIAL SPEED-MATCHING { OFF, ON }
  1952.     Tells whether the modem's interface speed is locked.  Default is OFF,
  1953.     meaning the modem changes its interface speed to match the connection
  1954.     speed, for example if you place a call at 2400 bps and it is answered at
  1955.     1200 bps.  Use ON if your modem is configured to do speed matching.
  1956.  
  1957.  
  1958. SET DIAL TIMEOUT number
  1959.     Seconds to wait for a response from the modem when dialing before giving up
  1960.     and declaring that the call could not be completed.  If you don't give this
  1961.     command, Kermit calculates its own dial timeout based on the modem type,
  1962.     length of the phone number, and transmission speed.  If that interval isn't
  1963.     long enough, use this command to specify a longer one.
  1964.  
  1965.  
  1966. SET DEBUG { ON, OFF, SESSION }
  1967.     SET DEBUG ON is equivalent to LOG DEBUG.  SET DEBUG SESSION means to
  1968.     display incoming control and 8-bit characters on the screen using special
  1969.     notation (see CONNECT).  SET DEBUG OFF turns off all debugging.
  1970.  
  1971.  
  1972. SET DELAY n
  1973.     How many seconds to wait before sending the first packet after a SEND
  1974.     command.  Used in remote mode to give you time to escape back to your local
  1975.     Kermit and issue a RECEIVE command before the first Kermit packet appears.
  1976.     Normally 5 seconds.
  1977.  
  1978.  
  1979. SET DUPLEX {FULL, HALF}
  1980.     For use during CONNECT.  Specifies which side is doing the echoing; FULL
  1981.     means the other side, HALF means C-Kermit must echo your keystrokes itself.
  1982.     Normally FULL.  Use half when communicating with IBM mainframes over
  1983.     linemode connections, and on similar half-duplex or local-echo connections.
  1984.     Synonym: SET LOCAL-ECHO {OFF, ON}.
  1985.  
  1986.  
  1987. SET ESCAPE-CHARACTER cc
  1988.     For use during CONNECT to get C-Kermit's attention.  The escape character
  1989.     acts as a prefix to an escape command, for instance to close the connection
  1990.     and return to C-Kermit or UNIX command level.  The normal escape character
  1991.     is Control-Backslash (ASCII 28).  See CONNECT.
  1992.  
  1993.  
  1994. SET FILE parameter value
  1995.     Establish file-related parameters:
  1996.  
  1997.     SET FILE BYTESIZE { 7, 8 }
  1998.         Normally 8.  If 7, strip the 8th bit from file data during file
  1999.         transfer.
  2000.  
  2001.  
  2002.     SET FILE CHARACTER-SET name
  2003.         tells the encoding of the local file, ASCII by default.  The names
  2004.         DUTCH, GERMAN, FRENCH, etc, refer to 7-bit ASCII-based national
  2005.         replacement character (NRC) sets.  CP866, CYRILLIC-ISO, and
  2006.         KOI8-CYRILLIC refer to sets used in the Soviet Union and other
  2007.         countries that use the Cyrillic alphabet.  Latin-1 is the 8-bit ISO
  2008.         8859 Latin Alphabet 1.  JAPANESE-EUC, DEC-KANJI, JIS7, and SHIFT-JIS
  2009.         are Japanese Kanji sets.  Type SET FILE CHAR ? for a complete list.
  2010.         When receiving files, C-Kermit translates from the transfer character
  2011.         set specified in the most recent SET TRANSFER CHARACTER-SET command or
  2012.         else the one announced in the Attribute packet (if any) into the file
  2013.         character set.  When sending files, C-Kermit translates from the
  2014.         current file character set into the current transfer character set.
  2015.  
  2016.  
  2017.     SET FILE COLLISION action
  2018.         Tells what to do when a file arrives that has the same name as an
  2019.         existing file.  The actions are:
  2020.  
  2021.         BACKUP
  2022.             (default) Rename the old file to a new, unique name and store the
  2023.             incoming file under the name it arrived with.  The "new unique"
  2024.             name is simply a new generation on VAX/VMS.  In UNIX, a "generation
  2025.             number" appended to the filename, separated by a tilde, as in
  2026.             oofa.txt.~8~[The new name for the arriving file is of the form
  2027.             foo.~n~, where foo is the name they share and n is a "generation
  2028.             number"; if foo exists, then the new file will be called foo.~1~.
  2029.             If foo and foo.~1~ exist, the new file will be foo.~2~, and so on.
  2030.             If the new name would be longer than the maximum length for a
  2031.             filename, then characters are deleted from the end first, for
  2032.             instance, thelongestname on a system with a limit of 14 characters
  2033.             would become thelonges.~1~.]
  2034.  
  2035.                 WARNING: UNIX C-Kermit presently offers no method of
  2036.                 automatically limiting the number of versions of a file
  2037.                 that can be created, so if too many of them pile up, you'll
  2038.                 have to delete the ones you don't need by hand.  Or,
  2039.                 because the version number syntax is compatible with GNU
  2040.                 EMACS backup files, you can use EMACS to do this for you.
  2041.  
  2042.             In OS/2, Kermit constructs names of the form FZZn.BAR, where
  2043.             FZZ.BAR is the name they share and n is a "generation number"; if
  2044.             FZZ.BAR exists, then the new file will be called FZZ00001.BAR.  If
  2045.             FZZ.BAR and FZZ00001.BAR exist, the new file will be FZZ00002.BAR,
  2046.             and so on.  If the common name were more than 6 characters long (eg
  2047.             GOODDATA.DAT), then the new name for the arriving file would be
  2048.             GOODD001.DAT and so on.
  2049.  
  2050.  
  2051.         OVERWRITE
  2052.             Overwrite (replace) the existing file.  The existing file is gone,
  2053.             destroyed.  Even if the file transfer fails or the incoming file is
  2054.             refused.  Use with caution.
  2055.  
  2056.  
  2057.         APPEND
  2058.             Append the incoming file to the end of the existing file.  This
  2059.             option is useful for adding information to a log file, but it
  2060.             should be used with caution to avoid, for example, joining two
  2061.             files of different types (like text and binary).
  2062.  
  2063.  
  2064.         DISCARD
  2065.             Refuse and/or discard the incoming file.  This option is handy for
  2066.             resuming multi-file transmissions that were broken.  Only those
  2067.             files that were not successfully transferred before will be
  2068.             accepted.
  2069.  
  2070.  
  2071.         RENAME
  2072.             Give the incoming file a unique name, like the BACKUP option,
  2073.             except that the incoming file gets the new name, rather than the
  2074.             existing file.
  2075.  
  2076.  
  2077.         UPDATE
  2078.             Accept the incoming file only if it is newer than the existing
  2079.             file.  This feature depends on the creation date field in the
  2080.             attribute packet.
  2081.  
  2082.  
  2083.  
  2084.     SET FILE DISPLAY { ON, OFF }
  2085.         Normally ON; when in local mode, display progress of file transfers on
  2086.         the screen (stdout), and watch the keyboard for interruptions.  If OFF
  2087.         (-q on command line) none of this is done, and the file transfer may
  2088.         proceed in the background oblivious to any other work concurrently done
  2089.         at the keyboard.
  2090.  
  2091.  
  2092.     SET FILE NAMES {CONVERTED, LITERAL}
  2093.         Normally CONVERTED, which means that outbound filenames have device,
  2094.         directory, and/or path specifications stripped, lowercase letters
  2095.         raised to upper, tildes and extra periods changed to X's, and an X
  2096.         inserted in front of any name that starts with period.  In VMS, the
  2097.         generation number is also stripped.  For UNIX only, incoming filenames
  2098.         have uppercase letters lowered.  LITERAL means that none of these
  2099.         conversions are done; therefore, any directory path appearing in a
  2100.         received file specification must exist and be write-accessible.  When
  2101.         literal naming is being used, the sender should not use path names in
  2102.         the file specification unless the same path exists on the target system
  2103.         and is writable.
  2104.  
  2105.  
  2106.     SET FILE RECORD-LENGTH n
  2107.         Tells the record length for fixed-format files, or the maximum record
  2108.         length for variable-format files, on systems like VAX/VMS where
  2109.         record-length is a meaningful concept.
  2110.  
  2111.  
  2112.     SET FILE TYPE {BINARY, TEXT}
  2113.         The file type is normally text, which means that conversion is done
  2114.         between the local computer's record format and Kermit's standard
  2115.         transfer format, for example between UNIX newline characters and
  2116.         Kermit's carriage-return/linefeed sequences.  BINARY means to transmit
  2117.         file contents without conversion.  Binary (`-i' in command line
  2118.         notation) is necessary for binary files, and desirable in all file
  2119.         transfers between like systems to cut down on overhead.
  2120.  
  2121.  
  2122.     For VAX/VMS, these are the file type options:
  2123.  
  2124.  
  2125.     SET FILE TYPE TEXT
  2126.         Regular Text mode.  Applies to incoming files only.  When SENDing
  2127.         files, C-Kermit determines their type automatically.
  2128.  
  2129.  
  2130.     SET FILE TYPE BINARY [ { FIXED, UNDEFINED } ]
  2131.         Applies to incoming files only.  Binary mode: incoming files are stored
  2132.         with no translation or conversion.  The default record format is FIXED,
  2133.         but you can specify UNDEFINED too.
  2134.  
  2135.  
  2136.     SET FILE TYPE IMAGE
  2137.         This one applies to both incoming and outbound files.  For incoming
  2138.         files, it's just like BINARY FIXED.  For outbound files, it means just
  2139.         send the blocks of the file as they are stored on the disk, and ignore
  2140.         the file's RMS attributes.  SET FILE TYPE BLOCK is a synonym (for
  2141.         compatibility with Kermit-32).
  2142.  
  2143.  
  2144.     SET FILE WARNING { ON, OFF }
  2145.         SET FILE WARNING is an old command, somewhat misnamed.  SET FILE
  2146.         COLLISION (above) should be used instead.  SET FILE WARNING ON is
  2147.         equivalent to SET FILE COLLISION RENAME and SET FILE WARNING OFF is
  2148.         equivalent to SET FILE COLLISION OVERWRITE.
  2149.  
  2150.  
  2151.  
  2152. SET FLOW-CONTROL {DTR/CD, NONE, RTS/CTS, XON/XOFF}
  2153.     Normally XON/XOFF for full duplex flow control.  Should be set to NONE if
  2154.     the other system cannot do Xon/Xoff flow control, or if you have issued a
  2155.     SET HANDSHAKE command.  If set to XON/XOFF, then HANDSHAKE should be set to
  2156.     NONE.  This setting applies during both terminal connection and file
  2157.     transfer.  Warning: This command may have no effect on certain UNIX
  2158.     systems, where Kermit puts the communication line into "rawmode" and
  2159.     rawmode precludes flow control.
  2160.  
  2161.  
  2162.     The DTR/CD and RTS/CTS options are two kinds of "hardware flow control",
  2163.     using special wires (other than the data wires) in the connector.  These
  2164.     forms of flow control (especially RTS/CTS) are especially useful with
  2165.     high-speed modems and similar devices.  But these options are only
  2166.     available in those versions of C-Kermit whose underlying operating system
  2167.     supports them.
  2168.  
  2169.  
  2170.     Certain versions of UNIX, such as that on the NeXT, provide RTS/CTS flow
  2171.     control in a different way, namely in the device driver.  For example,
  2172.     /dev/cua is the first dialout port on the NeXT without RTS/CTS flow
  2173.     control, and /dev/cufa is the same port, but with built-in RTS/CTS flow
  2174.     control.
  2175.  
  2176.  
  2177.  
  2178.  
  2179. SET HANDSHAKE {XON, XOFF, CR, LF, BELL, ESC, NONE}
  2180.     Normally NONE.  Otherwise, half-duplex communication line turnaround
  2181.     handshaking is done during file transfer, which means C-Kermit will not
  2182.     reply to a packet until it has received the indicated handshake character
  2183.     or has timed out waiting for it; the handshake setting applies only during
  2184.     file transfer.  If you SET HANDSHAKE to other than NONE, then FLOW should
  2185.     be set to NONE.
  2186.  
  2187.  
  2188. SET HOST name
  2189.     For communicating over a network rather than a terminal device.  Presently
  2190.     supported only for Berkeley-based or other UNIX implementations using the
  2191.     socket interface to a TCP/IP network, for VAX/VMS with the TGV MultiNet
  2192.     TCP/IP package, and for SunLink X.25.  For TCP/IP networks, the name is the
  2193.     hostname or IP host number of a host on the network, optionally followed by
  2194.     a colon and an IP service number.  By default, C-Kermit connects to the
  2195.     telnet (virtual terminal server) socket on TCP/IP connections.  For X.25
  2196.     networks, the name is the X.121 address.
  2197.  
  2198.  
  2199. SET INCOMPLETE {DISCARD, KEEP}
  2200.     Disposition for incompletely received files.  If an incoming file is
  2201.     interrupted or an error occurs during transfer, the part that was received
  2202.     so far is normally discarded.  If you SET INCOMPLETE KEEP then partial
  2203.     files will be kept.
  2204.  
  2205.  
  2206. SET INPUT {CASE, ECHO, TIMEOUT-ACTION}
  2207.     Controls the behavior of the INPUT command.  See the section on script
  2208.     programming.
  2209.  
  2210.  
  2211. SET KEY n [ string ]
  2212.     Key mapping for CONNECT mode.  Tell Kermit that when you press the key
  2213.     whose code is n during CONNECT mode, it should substitute the string in its
  2214.     place.  The string is entered in the native character set of your computer,
  2215.     or you can use backslash codes.  The characters are subject to the same
  2216.     translation and shifting rules as the characters you would enter manually
  2217.     at the keyboard during CONNECT mode.  The code n must be a number between 0
  2218.     and 255 (higher numbers are possible on some computers, like OS/2, if
  2219.     Kermit knows how to read your computer's keyboard scan codes).  A key
  2220.     mapping for code n applies to all keys that produce this code, for example
  2221.     SET KEY \9 \27 assigns the code 27 (ESC) to the TAB key and to the CTRL-I
  2222.     key.  To find out a key's code, enter the SHOW KEY command, then press the
  2223.     key or key combination.  Entering the SET KEY for key n without specifying
  2224.     a string results in removing any previous key mapping for key n, i.e. n
  2225.     sends itself.  Key mappings do not apply to escape-character arguments.  If
  2226.     the escape character appears in a SET KEY string, it is treated as an
  2227.     ordinary data character, but if a key definition is exactly one character
  2228.     long, and that character is the escape character, it is treated as the
  2229.     escape character.
  2230.  
  2231.  
  2232. SET LANGUAGE {ICELANDIC, GERMAN, NORWEGIAN, RUSSIAN, ...}
  2233.     For use with international text file transfer.  If you tell Kermit what
  2234.     language a text file is written in, then Kermit might be able to apply
  2235.     certain transliteration tricks when translating between the file character
  2236.     set and the transfer character set.  See the section on international
  2237.     character sets.
  2238.  
  2239.  
  2240. SET LINE [terminal-device-name]
  2241.     The device name for the communication line to be used for file transfer and
  2242.     terminal connection, e.g. /dev/ttyi3 on a UNIX system or TXA0: on a VAX/VMS
  2243.     computer.  If you specify a device name, Kermit will be in local mode, and
  2244.     you should remember to issue any other necessary SET commands, such as SET
  2245.     SPEED (on UNIX, at least, the SET SPEED command is not strictly necessary
  2246.     -- Kermit will use the line's current speed, but you should use SET SPEED
  2247.     anyway, so that you be sure that speed you desire is actually being used).
  2248.  
  2249.  
  2250.     If you omit the device name, Kermit will revert to its default mode of
  2251.     operation.  If you specify the default device name (/dev/tty in UNIX, TT:
  2252.     in VMS), Kermit will enter remote mode (useful when logged in through the
  2253.     "back port" of a system normally used as a local-mode workstation).
  2254.  
  2255.  
  2256.     Whenever you give a SET LINE command, C-Kermit closes any currently open
  2257.     communication device before attempting to open the new one.  Therefore SET
  2258.     LINE is also useful for closing and hanging up a dialed connection.
  2259.  
  2260.  
  2261.     When UNIX Kermit enters local mode, it attempts to synchronize with other
  2262.     programs (like uucp) that use external communication lines so as to prevent
  2263.     two programs using the same line at once; before attempting to lock the
  2264.     specified line, it will close and unlock any external line that was
  2265.     previously in use.  If your system does not allow you to have write access
  2266.     to the uucp lock directory, then you will receive a message like "Sorry,
  2267.     access to lock denied."  In this case, you must ask your system
  2268.     administrator to ensure that uucp lockfiles are set up correctly and Kermit
  2269.     is installed correctly.  If Kermit were to use the external line without
  2270.     proper coordination with uucp (and even other copies of Kermit), then two
  2271.     or more users could find themselves using the same line at the same time,
  2272.     which would prevent all useful communication.
  2273.  
  2274.  
  2275.     If you SET LINE to a communication port that has a modem attached, and you
  2276.     have SET CARRIER ON, then the SET LINE command will not return until
  2277.     carrier appears on the device.  This is useful for setting up a Kermit
  2278.     program that other people can dial in to.  You can control the amount of
  2279.     time Kermit will wait for carrier using SET CARRIER ON n, where n is the
  2280.     number of seconds to wait for a connection before timing out.  You can also
  2281.     interrupt a blocked SET LINE command by typing Ctrl-C.
  2282.  
  2283.  
  2284. SET MACRO { ECHO, ERROR } { ON, OFF }
  2285.     Tells whether the individual commands that comprise a macro should be
  2286.     echoed on the screen during macro execution (normally they are not), and
  2287.     whether an error during macro execution should terminate the macro
  2288.     immediately (normally it does not).  See the section on script programming.
  2289.  
  2290.  
  2291. SET MODEM-DIALER name
  2292.     The type of modem  dialer on the communication line; the name identifies
  2293.     the modem type: DIRECT, HAYES, RACALVADIC, VENTEL, etc.  "Direct" indicates
  2294.     either there is no dialout modem, or that if the line requires carrier
  2295.     detection to open, then SET LINE will hang waiting for an incoming call.
  2296.     HAYES, VENTEL, and the others indicate that SET LINE will prepare for a
  2297.     subsequent DIAL command for the given dialer.  UNKNOWN means a modem is
  2298.     attached, but of an unknown or unsupported type.  Support for new dialers
  2299.     is added from time to time, so type SET MODEM ? for a list of those
  2300.     supported in your copy of Kermit.  Also see the description of the DIAL and
  2301.     SET DIAL commands.  NOTE: the SET MODEM command must be given before the
  2302.     SET LINE command if you plan to use the DIAL command.
  2303.  
  2304.  
  2305. SET NETWORK {TCP/IP, X.25}
  2306.     Select the type of network that is to be used for SET HOST connections.
  2307.     TCP/IP is presently available for UNIX systems that support the Berkeley
  2308.     sockets library (such as BSD-based UNIXes, HP-UX, Xenix with Excelan
  2309.     TCP/IP) and for VAX/VMS with the TGV MultiNet library.  X.25 is available
  2310.     only for SUNs with the SunLink product (see section on X.25 support).
  2311.  
  2312.  
  2313. SET PAD
  2314.     (See X.25 section)
  2315.  
  2316.  
  2317. SET PARITY {EVEN, ODD, MARK, SPACE, NONE}
  2318.     Specify character parity for use in packets and terminal connection,
  2319.     normally NONE.  If other than NONE, C-Kermit will seek to use the 8th-bit
  2320.     prefixing mechanism for transferring 8-bit data, which can be used
  2321.     successfully only if the other Kermit agrees during the automatic feature
  2322.     negotiation phase; if not, 8-bit data cannot be successfully transferred.
  2323.     In Berkeley-based UNIX implementations, if you SET PARITY to other than
  2324.     NONE, this will also enable Xon/Xoff flow control during file transfer if
  2325.     FLOW is set to XON/XOFF; otherwise, flow control is not done (because the
  2326.     communication line must be opened in "raw mode" for 8-bit data, which
  2327.     precludes the use of Xon/Xoff flow control in Berkeley UNIX).
  2328.  
  2329.  
  2330. SET PROMPT [text]
  2331.     The given text will be substituted for "C-Kermit>" as this program's
  2332.     prompt.  If the text is omitted, the prompt will revert to "C-Kermit>".  If
  2333.     the text is enclosed in { curly braces }, the braces are stripped and any
  2334.     leading and trailing blanks are retained.  The text may contain backslash
  2335.     codes.
  2336.  
  2337.  
  2338. SET QUIET {ON, OFF}
  2339.     Normally OFF.  Various informational messages are issued by the user
  2340.     interface.  ON suppresses these messages (but not error messages).
  2341.     Equivalent to '-q' on the command line.
  2342.  
  2343.  
  2344. SET RECEIVE parameter value
  2345.     (See SET SEND.)
  2346.  
  2347.  
  2348. SET RETRY n
  2349.     Specify the maximum number of times a particular packet can be
  2350.     retransmitted (because of timeout or transmission errors) before Kermit
  2351.     gives up and declares the file transfer a failure.
  2352.  
  2353.  
  2354. SET {SEND, RECEIVE} parameter value
  2355.     These commands are used to modify the normal formats and procedures used by
  2356.     the Kermit file transfer protocol.  Normally they are not necessary, but
  2357.     they can be used to overcome unusual obstacles, or to improve Kermit's
  2358.     performance.
  2359.  
  2360.  
  2361.     The SET RECEIVE command lets you tell the other Kermit how it should format
  2362.     the packets it sends to you.  Give SET RECEIVE commands to the Kermit that
  2363.     is going to receive files.  If you plan to transfer files in both
  2364.     directions, give SET RECEIVE commands to both Kermits.
  2365.  
  2366.  
  2367.     The SET SEND command rarely needs to be used.  It is for overriding what
  2368.     the the other Kermit requests, and should be necessary only if you cannot
  2369.     use a SET RECEIVE command to modify the parameter in question on the
  2370.     receiving Kermit.
  2371.  
  2372.     SET {RECEIVE, SEND} END-OF-PACKET cc
  2373.         Specifies the control character that marks the end of a Kermit packet.
  2374.         Normally 13 (carriage return), which most Kermit implementations
  2375.         require.
  2376.  
  2377.  
  2378.     SET {RECEIVE, SEND} PACKET-LENGTH n
  2379.         Specify the maximum packet length, normally 90.  Shorter packet lengths
  2380.         can be useful on noisy lines, or with systems or front ends or networks
  2381.         that have small buffers.  The shorter the packet, the higher the
  2382.         overhead, but the lower the chance of a packet being corrupted by
  2383.         noise, and the less time to retransmit corrupted packets.  If you
  2384.         request a length greater than 94, "long packets" are used, which is a
  2385.         feature that not all other Kermit programs support (most popular ones
  2386.         do).  C-Kermit can send and receive packets up to about 2000 characters
  2387.         in length.  If you use longer packets, you should also request a
  2388.         stronger error checking method (see SET BLOCK-CHECK).  SET SEND
  2389.         PACKET-LENGTH overrides the value requested by the other Kermit during
  2390.         protocol initiation unless the other Kermit requests a shorter length.
  2391.  
  2392.  
  2393.     SET {RECEIVE, SEND} PAD-CHARACTER cc
  2394.         SET RECEIVE PAD-CHARACTER allows C-Kermit to request the other Kermit
  2395.         to use cc as a pad character.  Default cc is NUL, ASCII 0.  C-Kermit
  2396.         normally does not need to have incoming packets preceded with pad
  2397.         characters.  SET SEND PAD-CHARACTER designates a character to send
  2398.         before each packet.  Normally, none is sent.  Outbound padding is
  2399.         sometimes necessary for communicating with slow half duplex systems
  2400.         that provide no other means of line turnaround control.  It can also be
  2401.         used to send special characters to communications equipment that needs
  2402.         to be put in "transparent" or "no echo" mode, when this can be
  2403.         accomplished in by feeding it a certain control character.
  2404.  
  2405.  
  2406.     SET {RECEIVE, SEND} PADDING n
  2407.         How many pad characters to request or send, normally 0.
  2408.  
  2409.  
  2410.     SET {RECEIVE, SEND} START-OF-PACKET number
  2411.         The normal Kermit packet prefix is Control-A (1); this command changes
  2412.         the prefix C-Kermit puts on outbound packets.  The only reasons this
  2413.         should ever be changed would be: Some piece of equipment somewhere
  2414.         between the two Kermit programs will not pass through a Control-A; or,
  2415.         some piece of of equipment similarly placed is echoing its input.  In
  2416.         the latter case, the recipient of such an echo can change the packet
  2417.         prefix for outbound packets to be different from that of arriving
  2418.         packets, so that the echoed packets will be ignored.  The opposite
  2419.         Kermit must also be told to change the prefix for its inbound packets
  2420.         (use SET RECEIVE START on one Kermit and SET SEND START on the other).
  2421.  
  2422.  
  2423.     SET {RECEIVE, SEND} TIMEOUT n
  2424.         Normally, each Kermit partner sets its packet timeout interval based on
  2425.         what the opposite Kermit requests.  SET RECEIVE TIMEOUT allows you to
  2426.         override the normal procedure and specify a timeout interval for
  2427.         C-Kermit to use when waiting for packets from the other Kermit.  If you
  2428.         specify 0, then no timeouts will occur, and C-Kermit will wait forever
  2429.         for expected packets to arrive (relying on the other Kermit to provide
  2430.         the timeout function).  SET SEND TIMEOUT specifies the number of
  2431.         seconds to wait for a packet before timing it out and retransmitting or
  2432.         requesting retransmission.
  2433.  
  2434.  
  2435.  
  2436. SET SCRIPT ECHO {ON, OFF}
  2437.     Tell whether the SCRIPT command should echo its interactions with the
  2438.     remote host on your screen.  ON by default.
  2439.  
  2440.  
  2441. SET SERVER DISPLAY {ON, OFF}
  2442.     Specify whether C-Kermit, when in server mode, should put a file transfer
  2443.     display on the screen when it is in local mode.  Normally OFF.
  2444.  
  2445.  
  2446. SET SERVER TIMEOUT n
  2447.     Specify the time interval n in seconds for the C-Kermit server to send NAK
  2448.     packets while waiting for a command packet.  These NAKs are intended to
  2449.     break deadlocks in case a client Kermit that cannot time out sends a
  2450.     command packet which is lost.  However, the server command-wait NAKs can
  2451.     interfere with originate/answer devices that are to be used for answering.
  2452.     For example, you can run a C-Kermit server on a modem line that normally
  2453.     dials out, so that people can dial in to it and give Kermit commands.
  2454.     While waiting for the phone call to come, the server NAKs might "wake up"
  2455.     the modem and put it into originate mode, preventing the incoming call from
  2456.     being answered.
  2457.  
  2458.  
  2459. SET SESSION-LOG { BINARY, TEXT }
  2460.     Specify how the session log is to be written.  TEXT is the default, meaning
  2461.     that lines are written using the convention of the local system; for
  2462.     example, UNIX session logs will have carriage returns (and certain other
  2463.     extraneous characters like NUL) omitted.  BINARY means to record all
  2464.     characters in the session log.
  2465.  
  2466.  
  2467. SET SPEED n
  2468.     The transmission speed in bits per second ("baud rate") for the
  2469.     communication line specified in SET LINE (but not SET HOST).  This command
  2470.     cannot be used to change the speed of your own console terminal.  Some
  2471.     computers are set up in such a way that you must give this command after a
  2472.     SET LINE command before you can use the line.  Type SET SPEED ? to see what
  2473.     speeds are available.  Use speeds greater than 9600 with caution, since
  2474.     they are not necessarily supported by the communication devices on your
  2475.     computer or the other computer, or the communication path between them.
  2476.  
  2477.  
  2478. SET SUSPEND { OFF, ON }
  2479.     (UNIX only) On UNIX versions that support job control, C-Kermit can
  2480.     normally be put in the background by typing the suspend character (usually
  2481.     Ctrl-\), or giving C-Kermit the SUSPEND (or Z) command, or by using the Z
  2482.     connect-mode escape.  SET SUSPEND OFF disables this feature.  This is
  2483.     useful when suspending doesn't work right (e.g. on certain UNIX
  2484.     implementations that have bugs) or when you are running Kermit under the
  2485.     Bourne shell.
  2486.  
  2487.  
  2488. SET TAKE { ECHO, ERROR } { ON, OFF }
  2489.     SET TAKE ECHO tells whether commands from a TAKE file are displayed on the
  2490.     screen as they are executed (normally they are not).  SET TAKE ERROR
  2491.     controls whether execution of a TAKE command file should be terminated if
  2492.     an error occurs (normally it is not).
  2493.  
  2494.  
  2495. SET TERMINAL parameter value
  2496.     Used for specifying terminal parameters.
  2497.  
  2498.     SET TERMINAL BYTESIZE { 7, 8 }
  2499.         tells the character size to be used on the communication line between
  2500.         the local C-Kermit and the remote Kermit during terminal emulation
  2501.         (C-Kermit CONNECT command).  It's 7 by default, which means that the
  2502.         high-order (8th) bit is stripped from each incoming and outgoing
  2503.         character.  Use 8 for 8-bit character sets like ISO Latin Alphabet 1,
  2504.         but this will work only if the connection really is 8-bits no-parity.
  2505.         Compare with SET COMMAND BYTESIZE.
  2506.  
  2507.  
  2508.     SET TERMINAL CHARACTER SET <remote-set> [ <local-set> ]
  2509.         For use during CONNECT.  Specify the character set that is being sent
  2510.         to C-Kermit by the remote computer, and specify which local character
  2511.         set to translate it into.  If the local character set is omitted, the
  2512.         current file character set is used.  The choices for the character sets
  2513.         are the same as for C-Kermit's file character sets (see SET FILE
  2514.         CHARACTER-SET).  SET TERMINAL CHARACTER-SET TRANSPARENT (which is
  2515.         Kermit's startup default) means no translation is done.  Equivalently,
  2516.         no translation is done if the local and remote sets are specified to be
  2517.         the same.  When they are different, translation goes through the Latin
  2518.         Alphabet 1 unless the local character set is Cyrillic-based in which
  2519.         case it goes through the Latin/Cyrillic Alphabet.  Kanji terminal
  2520.         character-sets are not supported.
  2521.  
  2522.  
  2523.     SET TERMINAL LOCKING-SHIFT { OFF, ON }
  2524.         Tells C-Kermit whether to use Shift-In/Shift-Out (Ctrl-O and Ctrl-N) to
  2525.         switch between 7-bit and 8-bit characters during CONNECT.  Applies to
  2526.         the Kermit-to-remote part of the connection only, and it applies to
  2527.         both the characters you type and to those Kermit receives from the
  2528.         remote.  OFF by default.
  2529.  
  2530.  
  2531.     SET TERMINAL NEWLINE { ON, OFF }
  2532.         OFF is the default.  When ON, Kermit sends CRLF whenever you type CR
  2533.         during terminal emulation.
  2534.  
  2535.  
  2536.     SET TERMINAL TYPE { VT100, TEK }
  2537.         (OS/2 C-Kermit only) Select the type of terminal to emulate.
  2538.  
  2539. Terminal parameters can be displayed with the SHOW TERMINAL command.
  2540.  
  2541.  
  2542. SET TRANSFER CHARACTER-SET name
  2543.     Tells what character set should be used for file data within Kermit packets
  2544.     during transfer of text files.  The choices are:
  2545.  
  2546.     TRANSPARENT
  2547.         Don't translate characters at all.
  2548.  
  2549.  
  2550.     ASCII
  2551.         Means to use the 7-bit ASCII (American Standard Code for Information
  2552.         Interchange) character set.  If the local file character set contains
  2553.         characters that do not occur in ASCII (like accented letters),
  2554.         represent them in ASCII the best way possible.
  2555.  
  2556.  
  2557.     CYRILLIC-ISO
  2558.         Means to use the ISO 8859-5 Latin/Cyrillic Alphabet, which is capable
  2559.         of representing Russian, Ukrainian, Bulgarian, Serbian, etc.
  2560.  
  2561.  
  2562.     LATIN1
  2563.         Means to use ISO 8859 Latin Alphabet 1, which is capable of
  2564.         representing most western European languages (English, German, Spanish,
  2565.         Dutch, Italian, Norwegian, Danish, Swedish, Portuguese, etc).
  2566.  
  2567.  
  2568.     JAPANESE-EUC
  2569.         Means to use Japanese Extended UNIX Code, which is a mixture of 7-bit
  2570.         Roman (Japanese ISO 646, similar to ASCII), single-byte Katakana, and
  2571.         double-byte JIS X 0208 Kanji.
  2572.  
  2573.  
  2574.  
  2575. SET TRANSMIT parameter value
  2576.     Controls the behavior of the TRANSMIT command, used for uploading files to
  2577.     computers that don't have Kermit programs.  See TRANSMIT.  The parameters
  2578.     are:
  2579.  
  2580.     ECHO { OFF, ON }
  2581.         Controls whether the characters that are sent to the other computer are
  2582.         also displayed on your screen.  The default is ON.
  2583.  
  2584.  
  2585.     EOF string
  2586.         String to send after sending the file, for example SET TRANSMIT EOF \4
  2587.         to send a Ctrl-D.
  2588.  
  2589.  
  2590.     FILL character
  2591.         ASCII value of character to insert into blank lines.  Some computers
  2592.         ignore blank lines, others might terminate the upload when they receive
  2593.         a blank line.  Use this command to insert a character, such as space
  2594.         (32) or X (88), in any blank line.
  2595.  
  2596.  
  2597.     LINEFEED { ON, OFF }
  2598.         Transmit linefeed as well as carriage return at the end of each line.
  2599.         Normally, only CR is sent.
  2600.  
  2601.  
  2602.     LOCKING-SHIFT { ON, OFF }
  2603.         Whether to send the locking-shift characters SO (Ctrl-N) and SI
  2604.         (Ctrl-O) around 8-bit characters when transmitting and PARITY is not
  2605.         NONE.
  2606.  
  2607.  
  2608.     PAUSE n
  2609.         Number of milliseconds (1000 milliseconds = 1 second) to pause after
  2610.         sending each line of a text file, or each character of a binary file
  2611.         (according to SET FILE TYPE).  Maximum 1000, default 0.
  2612.  
  2613.  
  2614.     PROMPT n
  2615.         ASCII value of character to look for from host before sending next
  2616.         line, normally LF (10), in text mode only; 0 means not to wait for any
  2617.         responses from the host -- just send all the characters in a steady
  2618.         stream.  This command has no effect in binary mode (i.e. when FILE TYPE
  2619.         is set to BINARY).
  2620.  
  2621. Synonym: SET XMIT.
  2622.  
  2623.  
  2624. SET UNKNOWN-CHAR-SET { DISCARD, KEEP }
  2625.     Tells what to do if a file arrives whose Attribute packet announces a
  2626.     transfer character set unknown to C-Kermit.
  2627.  
  2628.  
  2629. SET WILDCARD-EXPANSION { KERMIT, SHELL }
  2630.     (UNIX only) Tells who should expand wildcard characters in SEND and similar
  2631.     commands: KERMIT (the default) or the user's preferred UNIX shell (such as
  2632.     sh, csh, or ksh).
  2633.  
  2634.  
  2635. SET WINDOW n
  2636.     Select a window size.  This refers to Kermit's sliding window packet
  2637.     transport protocol.  Normally, Kermit sends a packet, waits for the reply,
  2638.     then sends the next packet, and so on.  This is called "stop and wait"
  2639.     operation, corresponding to a window size of 1, and is supported by all
  2640.     Kermit programs.  If you select a window size greater than 1, and if the
  2641.     other Kermit supports sliding windows, then multiple packets (up to the
  2642.     window size) can be sent before any replies are required.  This allows file
  2643.     transfer to operate efficiently over connections that have long delays,
  2644.     like over public data networks or through satellites.
  2645.  
  2646.  
  2647.     With a sufficiently large window size, transmission can be continuous with
  2648.     no pauses or delays.  The maximum window size is 31, but sizes greater than
  2649.     5 or 10 are rarely necessary.
  2650.  
  2651.  
  2652.     Sliding windows may be used in conjunction with long packets, but the
  2653.     maximum length for packets decreases with increasing window size.
  2654.  
  2655.  
  2656.     Kermit uses the "selective retransmission" technique, so that if packets
  2657.     are damaged during sliding windows transfers, only the damaged packets are
  2658.     retransmitted.
  2659.  
  2660.  
  2661. SET X.25
  2662.     (See X.25 section)
  2663.  
  2664.  
  2665. The SHOW Command
  2666.  
  2667. Syntax: SHOW category
  2668.  
  2669. The SHOW command with the default argument of "parameters" displays the values
  2670. of most of the SET parameters described above.  If you type a category name
  2671. after SHOW, then a more detailed report of parameters within the named category
  2672. are displayed, for example SHOW COMMUNICATIONS, SHOW PROTOCOL.  Type SHOW ? to
  2673. see a list of the available categories.
  2674.  
  2675.  
  2676. 1.12. Backslash Notation
  2677.  
  2678. \ (backslash) in any command means that what follows is not ordinary text, but
  2679. rather a code, variable, or function whose value is to be substituted into the
  2680. command at that point.  The character after the backslash identifies which kind
  2681. of quantity this is:
  2682.  
  2683.     % A user-defined simple (scalar) variable
  2684.     & an array reference
  2685.     $ an environment variable
  2686.     v (or V) a built-in variable
  2687.     f (or F) a function
  2688.     d (or D) a decimal (base 10) number
  2689.     o (or O) an octal (base 8) number
  2690.     x (or X) a hexadecimal (base 16) number
  2691.     \ the backslash character itself
  2692.     \b
  2693.       (or \B) the BREAK signal (OUTPUT command only)
  2694.     \l
  2695.       (or \L) a Long BREAK signal (OUTPUT command only)
  2696.     a decimal digit
  2697.       a 1-3 digit decimal number.
  2698.     anything else
  2699.       The following character is taken literally.
  2700.  
  2701. Variables, arrays, functions, etc, are explained in the next section.  Numbers
  2702. can be expressed in backslash notation in the following ways:
  2703.  
  2704. \{...}
  2705.     A grouped number, braces discarded, e.g. \{17}5 is not the same as \175.
  2706.  
  2707.  
  2708. \nnn
  2709.     (1-3 decimal digits) replaced by binary number 0-255, e.g.  \13 represents
  2710.     carriage return (ASCII 13).
  2711.  
  2712.  
  2713. \dnnn or \Dnnn - Same as \nnn
  2714.  
  2715.  
  2716. \onnn or \Onnn (1-3 octal digits) replaced by binary number 0-255.
  2717.  
  2718.  
  2719. \xnn or \Xnn (2 hexadecimal digits) replaced by binary number 0-255.
  2720.  
  2721. Numbers expressed in backslash notation are typically used to express
  2722. nonprintable ASCII characters within character strings, or in commands that
  2723. want you to enter the ASCII value of a character.  Examples:
  2724.  
  2725.     echo \7Wake up!\7            ; A message with beeps
  2726.     echo \27[H\27[J              ; VT100 clear-screen sequence
  2727.     set pad-character \o177      ; The ASCII character DEL
  2728.  
  2729.  
  2730. 1.13. Macros, Variables, and Script Programming
  2731.  
  2732. C-Kermit's script programming language is based upon that of MS-DOS Kermit, and
  2733. it is in most ways upwards compatible with it, meaning that many MS-DOS Kermit
  2734. script programs (or TAKE files in general) will work in C-Kermit with little or
  2735. no modification.  C-Kermit also has a SCRIPT command that provides a terse but
  2736. cryptic shorthand for automating certain kinds of interactive operations (see
  2737. Section 1.14).
  2738.  
  2739.  
  2740. 1.13.1. Variables
  2741.  
  2742. A variable name is of the form \%i, where i is a single letter or digit.
  2743. Letter-variables are different from digit-variables, which are used as macro
  2744. parameters.  The alphabetic case of a letter-variable doesn't matter:  \%a is
  2745. the same variable as \%A.
  2746.  
  2747. All variables have character strings as values.  A variable is considered to
  2748. exist if its value is a string of at least one character in length, otherwise
  2749. it is "undefined" and does not exist.
  2750.  
  2751. A value is given to a variable using the DEFINE or ASSIGN command:
  2752.  
  2753. DEFINE name [ text ]
  2754.     The named variable (or macro, see below) is created, with text as a value.
  2755.     If a macro or variable of the given name already exists, its definition is
  2756.     replaced with the new one.  The given text is copied into the definition
  2757.     literally.  If it contains any variable names, functions references, etc,
  2758.     these are simply copied, rather than evaluated.
  2759.  
  2760.  
  2761. ASSIGN name text
  2762.     The text is evaluated, and then the named variable or macro's value is set
  2763.     to the evaluated text.  This differs from DEFINE, which does not evaluate
  2764.     the text, but rather copies it literally.  The distinction between ASSIGN
  2765.     and DEFINE doesn't matter unless the text contains variable names.  With
  2766.     ASSIGN, the contents of the variable is copied, whereas with DEFINE, the
  2767.     name of the variable is copied.
  2768.  
  2769. To illustrate the difference between DEFINE and ASSIGN:
  2770.  
  2771.     def \%a Monday
  2772.     def \%b Today is \%a
  2773.     assign \%c Today is \%a
  2774.     def \%a Tuesday
  2775.     echo \%b
  2776.     echo \%c
  2777.  
  2778. The definition of \%b is "Today is \%a", so that whenever the value of \%a
  2779. changes, so does the value of \%b.  The definition of \%c, however, is fixed as
  2780. "Today is Monday", because "Monday" was the value of \%a at the time that \%c
  2781. was assigned.
  2782.  
  2783. A variable can be used in any Kermit command simply by referring to its name:
  2784.  
  2785.     echo \%a
  2786.  
  2787. and variables can be undefined by DEFINEing or ASSIGNing nothing to them, for
  2788. example:
  2789.  
  2790.     define \%a
  2791.  
  2792. You can define variables with long names, too:
  2793.  
  2794.     define telephone-number 7654321
  2795.  
  2796. But you have to refer to them in a special way, \m(name), e.g.:
  2797.  
  2798.     echo \m(telephone-number)
  2799.  
  2800. A special kind of variable is called an array.  This is simply a list, in which
  2801. each element has a number.  An array reference looks like \&a[i].  The \& means
  2802. this is an array element rather than a simple variable, the letter tells which
  2803. array it is (a, b, c, ..., z), and the brackets enclose an index which tells
  2804. which member of the array is being referred to: 1, 2, 3, etc.  The index can be
  2805. a number, or it can be a variable or function (even another array element) that
  2806. has a numeric value.  Array indices must be (or evaluate to) zero or greater.
  2807.  
  2808. Arrays have to be declared before you can use them, so Kermit will know how big
  2809. the array is and can create storage for it.  The command is DECLARE, for
  2810. example:
  2811.  
  2812.     DECLARE \&A[100]
  2813.  
  2814. This tells Kermit to create an array called \&a with 100 elements.  Once an
  2815. array is declared, its elements can be used just like simple variables:
  2816.  
  2817.     DEFINE \&A[3] Tuesday
  2818.  
  2819. An entire array can be destroyed like this:
  2820.  
  2821.     DECLARE \&A[0]
  2822.  
  2823. If you refer to an element of an array that is not declared, the reference is
  2824. replaced by the empty string.
  2825.  
  2826. The array \&@[] is predeclared.  It contains the command line that the Kermit
  2827. program was invoked with, one word per array element.  The number of elements
  2828. in the array is given in the built-in variable \v(args) (described later).
  2829. Example:
  2830.  
  2831.     $ kermit -p e -b 3
  2832.  
  2833. Here \&@[0] is the Kermit program's file specification, like
  2834. /usr/local/bin/kermit; \&@[1] is -p, \&@[2] is e, and so on.
  2835.  
  2836. The simple variables \%a..\%z and the arrays \&a[]..\&z[] are all global, which
  2837. means they can be referenced from anywhere in your script program, including
  2838. from within a TAKE file or macro.
  2839.  
  2840. You can list the names and values of all existing global simple variables with
  2841. the SHOW GLOBALS command, and you can list the names and dimensions of all
  2842. declared arrays with SHOW ARRAYS.
  2843.  
  2844.  
  2845. 1.13.2. Macros
  2846.  
  2847. A Kermit macro is a list of one or more Kermit commands that can be referred to
  2848. by a single name.  Like variables, macros are created by the DEFINE (or ASSIGN)
  2849. command:
  2850.  
  2851.     define ibm set parity mark, set duplex half, set handsh xon
  2852.  
  2853. and unlike variables, macros do not have weird-looking names; macro names can
  2854. be ordinary words.
  2855.  
  2856. Once a macro is defined, you can execute all of its commands simply by typing
  2857. the macro's name:
  2858.  
  2859.     C-Kermit>ibm
  2860.  
  2861. If you have defined a macro that has the same name as one of Kermit's built-in
  2862. commands, you will have to insert the word DO before the name in order to
  2863. execute the macro rather than the built-in command:
  2864.  
  2865.     C-Kermit>do ibm
  2866.  
  2867. (you can also use the word DO to invoke any macro).  In these examples, "IBM"
  2868. and "DO IBM" are the macro invocations.  If you follow a macro invocation by
  2869. one or more "words" (a word is a sequence of characters delimited by spaces, or
  2870. else at the end of a line), then each of these words is assigned to a
  2871. digit-variable that is accessible to the commands within the macro definition.
  2872. These trailing "words" are called the macro parameters.  The first parameter is
  2873. assigned to \%1, the second to \%2, and so on, up to a maximum of nine.  The
  2874. variable \%0 contains the name of the macro:
  2875.  
  2876.     define demo echo \%0: \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9
  2877.     demo this is a test of macro argument passing
  2878.  
  2879. Variables that do not have corresponding parameters are undefined (empty).  The
  2880. number of arguments passed to the macro is available in the named variable
  2881. \v(argc)(which, for compatibility with MS-DOS Kermit, may also be referred to
  2882. simply as ARGC, but only within IF conditions.)  Macro parameters are local to
  2883. the macro they are passed to.  If macro A invokes macro B, macro B gets its own
  2884. set of parameters, which are separate from macro A's, so that macro A still has
  2885. its own parameters available after macro B has completed.  The variables
  2886. \%0..\%9 may be used as global variables at "top level", when no macros are
  2887. active, by assigning values to them in the normal way.  To demonstrate:
  2888.  
  2889.     define xx echo \%1, yy Sneezy, echo \%1
  2890.     define yy echo \%1, zz Grumpy, echo \%1
  2891.     define zz echo \%1
  2892.     xx Sleepy
  2893.  
  2894. Try this, and you'll see how the value of \%1 is saved and restored at each
  2895. level.
  2896.  
  2897. Macro parameter words may be grouped into single parameters by enclosing them
  2898. in braces.  Try the following example to see how this works:
  2899.  
  2900.     define msg echo \%0: \%1
  2901.     msg this is another test of macro argument passing
  2902.     msg {this is yet another test of macro argument passing}
  2903.  
  2904. You can have a macro list its arguments on your screen by including the command
  2905. SHOW ARGUMENTS within the macro definition.
  2906.  
  2907. You can list the names and definitions of all existing macros with the SHOW
  2908. MACROS command.  If you include a name, as in "SHOW MACROS FOO", it will list
  2909. the definition(s) of only those macros whose names start with the character(s)
  2910. you have specified.
  2911.  
  2912. If you define a macro named ON_EXIT, it will be executed automatically when the
  2913. Kermit program exits.
  2914.  
  2915.  
  2916. 1.13.3. Named Variables
  2917.  
  2918. Built-in named variables are read-only, you cannot change them.  Their names
  2919. are of the form \v(name), in which the v can be lower or uppercase, and the
  2920. parentheses are required around the variable name.  If you refer to a named
  2921. variable that does not exist, it will be evaluated as the empty (zero-length)
  2922. string.  C-Kermit's variables are:
  2923.  
  2924.     \v(argc)
  2925.         number of arguments passed to currently active macro.
  2926.  
  2927.  
  2928.     \v(args)
  2929.         number of arguments passed to the program on the command line.  The
  2930.         program argument vector is assigned to the array \&@[].
  2931.  
  2932.  
  2933.     \v(count)
  2934.         current value of COUNT (loop control via SET COUNT, IF COUNT).
  2935.  
  2936.  
  2937.     \v(cpu)
  2938.         CPU hardware type, if known, otherwise "unknown".
  2939.  
  2940.  
  2941.     \v(date)
  2942.         current date in dd mmm yyyy format (e.g. 8 Feb 1990 or 10 Nov 1990)
  2943.  
  2944.  
  2945.     \v(directory)
  2946.         current device and/or directory.
  2947.  
  2948.  
  2949.     \v(filespec)
  2950.         file specification from most recent SEND, MSEND, or GET command, or the
  2951.         name of the file most recently received.
  2952.  
  2953.  
  2954.     \v(fsize)
  2955.         size of last file transferred.
  2956.  
  2957.  
  2958.     \v(home)
  2959.         user's home (login) directory name.
  2960.  
  2961.  
  2962.     \v(host)
  2963.         computer hostname.
  2964.  
  2965.  
  2966.     \v(input)
  2967.         current INPUT buffer contents.
  2968.  
  2969.  
  2970.     \v(line)
  2971.         current communication device or network host.
  2972.  
  2973.  
  2974.     \v(ndate)
  2975.         current date in numeric format, e.g. 19901225.
  2976.  
  2977.  
  2978.     \v(ntime)
  2979.         current time in seconds since midnight, 0 through 86399.
  2980.  
  2981.  
  2982.     \v(platform)
  2983.         name specific machine or environment C-Kermit was built for.
  2984.  
  2985.  
  2986.     \v(return)
  2987.         Value of most recent RETURN command.
  2988.  
  2989.  
  2990.     \v(speed)
  2991.         Transmission speed of current communication device, if known.  (A
  2992.         spurious value of 38400 might be reported for pseudoterminals.)
  2993.  
  2994.  
  2995.     \v(status)
  2996.         0 if the previous command succeeded, nonzero if it failed.
  2997.  
  2998.  
  2999.     \v(system)
  3000.         name of generic operating system C-Kermit was built for, such as UNIX
  3001.         or VMS.
  3002.  
  3003.  
  3004.     \v(tfsize)
  3005.         total size of all files in the last group of files that was
  3006.         transferred.
  3007.  
  3008.  
  3009.     \v(time)
  3010.         current time in hh:mm:ss 24-hour clock format (e.g. 13:45:23).
  3011.  
  3012.  
  3013.     \v(ttyfd)
  3014.         file descriptor of communication device (UNIX only).
  3015.  
  3016.  
  3017.     \v(version)
  3018.         numeric version number of C-Kermit.
  3019.  
  3020. You can use these variables in any Kermit command where their values would make
  3021. sense:
  3022.  
  3023.     echo It is \v(time) o'clock on \v(date)
  3024.  
  3025. A \v-variable's name can be abbreviated, as long as the abbreviation is enough
  3026. to distinguish it from all the other built-in variable names:  \v(dir),
  3027. \v(ver), etc.
  3028.  
  3029. You can get a listing of Kermit's built-in variables and their values with the
  3030. SHOW VARIABLES command.
  3031.  
  3032.  
  3033. 1.13.4. Built-in Functions
  3034.  
  3035. Built-in functions are of the form \fname(args).  The F and the name can be
  3036. upper or lower case.  The args are a comma-separated list of arguments.  The
  3037. function reference is replaced by its value.  For example:
  3038.  
  3039.     define \%a ABC123XYZ
  3040.     define \%b ...\Flower(\%a)...
  3041.  
  3042. results in a value of ...abc123xyz... for \%b.
  3043.  
  3044. The names of built-in functions and variables can be abbreviated to their
  3045. minimum unique length, for example \feval(1+1), \v(dir), etc.  C-Kermit's
  3046. functions include string-oriented functions that return a string:
  3047.  
  3048.     \Fliteral(arg)
  3049.         Copies its argument literally, without any evaluation.
  3050.  
  3051.  
  3052.     \Fcharacter(arg)
  3053.         Returns the single character corresponding to its argument, which must
  3054.         be numeric.  For example, \fchar(65) is 'A', \fchar(193) is A-acute (in
  3055.         the Latin-1).  If you give a negative number or a number larger than
  3056.         255, only the low-order 8 bits are used.
  3057.  
  3058.  
  3059.     \Fsubstr(arg1,arg2,arg3)
  3060.         Substring of the string arg1 starting at position arg2, of length arg3.
  3061.         arg2 and arg3 must be numbers or variables that have numeric values.
  3062.         Example:
  3063.  
  3064.             echo \fsubst(hello there,7,5)
  3065.  
  3066.         extracts the word "there".  The following is equivalent:
  3067.  
  3068.             define \%a hello there
  3069.             define \%b 7
  3070.             define \%c 5
  3071.             echo \fsubst(\%a,\%b,\%c)
  3072.  
  3073.  
  3074.  
  3075.     \Flower(arg)
  3076.         Converts all uppercase letters in its argument to lowercase, for
  3077.         example:
  3078.  
  3079.             define \%a FINE
  3080.             echo This is a \flower(\%a Mess).
  3081.  
  3082.         prints "This is a fine mess."
  3083.  
  3084.  
  3085.     \Fupper(arg)
  3086.         Converts all lowercase letters in its argument to uppercase.
  3087.  
  3088.  
  3089.     \Freverse(arg)
  3090.         Reverses the order of the characters in its argument, for example
  3091.         \frev(mupeen) is neepum.
  3092.  
  3093.  
  3094.     \Frepeat(arg1,arg2)
  3095.         Repeats the first argument the number of times given by the second
  3096.         argument, for example:
  3097.  
  3098.             echo +\frep(-+,10)
  3099.  
  3100.         produces +-+-+-+-+-+-+-+-+-+-+.
  3101.  
  3102.  
  3103.     \Flpad(text,n,c)
  3104.         Left-pads the text out to length n with character c.  If c is omitted,
  3105.         blank (space) is used.
  3106.  
  3107.  
  3108.     \Frpad(text,n,c)
  3109.         Right-pads the text out to length n with character c.  If c is omitted,
  3110.         blank (space) is used.
  3111.  
  3112.  
  3113.     \Fexecute(macroname macro-args)
  3114.         Execute the named macro with the given parameters (if any), return the
  3115.         macro's RETURN value if any (see RETURN).
  3116.  
  3117.  
  3118.     \Fcontents(variable-name)
  3119.         Returns the current definition (contents) of a variable.  If the
  3120.         definition includes variable names or function references, these are
  3121.         copied literally, without evaluation.
  3122.  
  3123.  
  3124.     \Fdefinition(macro-name)
  3125.         Returns the literal definition of the named macro.
  3126.  
  3127. Here are the string functions that return a number:
  3128.  
  3129.     \Flength(arg)
  3130.         Returns the length of the argument string.
  3131.  
  3132.  
  3133.     \Findex(arg1,arg2,arg3)
  3134.         Returns the position of the first occurrence string arg1 in string
  3135.         arg2, starting at position arg3.  If arg3 is omitted, then starting at
  3136.         the beginning.
  3137.  
  3138. File functions:
  3139.  
  3140.     \Ffiles(filespec)
  3141.         Returns the number of files that match the given file specification,
  3142.         for example \ffiles(ck*.c).
  3143.  
  3144.  
  3145.     \Fnextfile()
  3146.         Returns the next filename that matches the \Ffiles() file
  3147.         specification.  Use this in a counted loop (see below) after executing
  3148.         \Ffiles().
  3149.  
  3150. Integer arithmetic functions:
  3151.  
  3152.     \Fmax(arg1,arg2)
  3153.         Returns the maximum of its two numeric arguments.
  3154.  
  3155.  
  3156.     \Fmin(arg1,arg2)
  3157.         Returns the minimum of its two numeric arguments.
  3158.  
  3159.  
  3160.     \Feval(expression)
  3161.         Evaluates the given arithmetic expression.  The operands of the
  3162.         expression can be numeric strings or variables, or functions that
  3163.         evaluate to numeric strings.  The precedence is the normal, intuitive
  3164.         algebraic (or programming) precedence, and can be altered by the use of
  3165.         parentheses, which have higher precedence than any other operator.
  3166.         Spaces may be used to separate operators from operands, but they are
  3167.         not required.
  3168.  
  3169. Table 1-1 shows the types of expressions accepted by \feval().
  3170.  
  3171. -------------------------------------------------------------------------------
  3172.  
  3173.  
  3174.     Operator  Fix   Precedence   Operation          Example
  3175.  
  3176.      (   )              1         Group             (\%a + 3) * (\%1-5)
  3177.        !      Post      2         Factorial         \%x! - (\%x-2)!
  3178.  
  3179.        ~      Pre       3         Logical NOT       ~\%n
  3180.        -      Pre       3         Negative          -\%n
  3181.  
  3182.        ^      In        4         Raise to power    2^\%p
  3183.  
  3184.        *      In        5         Multiply          \%c * 5
  3185.        /      In        5         Divide            \%c / 5
  3186.        %      In        5         Modulus           \%c % 5
  3187.        &      In        5         Logical AND       \%c & 5
  3188.  
  3189.        +      In        6         Add               \%t + \%u
  3190.        -      In        6         Subtract          27 - \%x
  3191.        |      In        6         Logical OR        \%z | 4
  3192.        #      In        6         Exclusive OR      \%z # 4
  3193.        @      In        6         Greatest Common   \%z @ 30
  3194.                                   Divisor
  3195.  
  3196.                    Table 1-1:  \feval() Arithmetic Functions
  3197.  
  3198. -------------------------------------------------------------------------------
  3199.  
  3200. You can list the names of Kermit's built-in functions with the SHOW FUNCTIONS
  3201. command.
  3202.  
  3203. Two Kermit commands are also available to perform simple arithmetic on
  3204. variables:
  3205.  
  3206. INCREMENT name [value]
  3207.     Add value to the named variable.  If value is omitted, add 1.  If the
  3208.     variable does not have a numeric value, this command has no effect.
  3209.     Examples: inc \%a, incr \%b 10.
  3210.  
  3211.  
  3212. DECREMENT name [value]
  3213.     Subtract value from the named variable.  If value is omitted, subtract 1.
  3214.     If the variable does not have a numeric value, this command has no effect.
  3215.  
  3216.  
  3217. 1.13.5. Script Programming
  3218.  
  3219. Kermit's script programming language lets you write procedures, or programs,
  3220. that can include any Kermit command.  Variables and functions can be referenced
  3221. at practically any point in any command.  Control structures are provided for
  3222. decision making, transfer of control, looping, scoping of variables, and so
  3223. forth.  A script program can be a TAKE file, a macro, or any combination of the
  3224. two.
  3225.  
  3226. The basic idea of a script program is to automate tasks that you would normally
  3227. do "by hand" when interacting with another computer: dialing the modem,
  3228. negotiating through network boxes and front ends, logging in, etc etc.  You can
  3229. also write programs to manage local files, or to do anything that you could do
  3230. manually with Kermit.
  3231.  
  3232. To automate interaction with another computer, you need a replacement for the
  3233. CONNECT command.  This comes in two parts, an OUTPUT command that "types" what
  3234. you would type during CONNECT, and an INPUT command that reads the other
  3235. computer's responses, plus a couple related commands:
  3236.  
  3237. OUTPUT text
  3238.     Send the text to the other computer.  The text can be any combination of
  3239.     plain ordinary characters, backslash codes, variables, and functions.  To
  3240.     send a BREAK signal, include \\B in the OUTPUT string.  To send a Long
  3241.     BREAK signal, include \\L in the OUTPUT string.
  3242.  
  3243. INPUT timeout text
  3244.     Read responses from the other computer.  Wait up to timeout seconds for the
  3245.     specified text to appear.  If the text appears within the timeout interval,
  3246.     the command succeeds immediately.  Otherwise it fails.  The text can
  3247.     contain any combination of ordinary characters, backslash codes, variables,
  3248.     and functions.  If you want to include leading and/or trailing blanks in
  3249.     the INPUT text, surround it with braces, as in:
  3250.  
  3251.         input 10 {login: }
  3252.  
  3253.     INPUT can be interrupted with Ctrl-C, in which case it fails.
  3254.  
  3255. REINPUT timeout text
  3256.     Searches previous responses from the computer for the given text.  The
  3257.     timeout parameter is ignored.  The previous responses are stored in the
  3258.     INPUT buffer, which is 256 characters long, and which may also be accessed
  3259.     via the \v(input) variable.
  3260.  
  3261. ECHO [ text ]
  3262.     Display the text on the local screen, followed by a newline.  The text can
  3263.     contain any combination of backslash codes, variables, functions, etc.
  3264.  
  3265. CLEAR
  3266.     Clear any as-yet-unread characters from the communication device's input
  3267.     buffer.
  3268.  
  3269. PAUSE [ n ]
  3270.     Do nothing for the indicated number of seconds.  If a number is not given,
  3271.     pause for 1 second.  If anything is typed on the keyboard during the pause
  3272.     interval, "wake up".  PAUSE can be interrupted by typing Ctrl-C (or any
  3273.     other character), in which case it fails.
  3274.  
  3275. WAIT [ n [ { CD, CTS, DSR } ] ]
  3276.     Wait up to n seconds for the specified modem signals to appear on the
  3277.     currently selected communication device.  If you don't include any modem
  3278.     signal names, WAIT is equivalent to PAUSE.  If you include one or more
  3279.     signal names (separated by spaces), Kermit will wait for all of the
  3280.     specified signals to appear.  If they don't appear within the alloted time,
  3281.     or if the device does not have modem control, then the command will fail.
  3282.     You may interrupt the WAIT command by typing any character at the keyboard,
  3283.     in which case the command will fail.  The command will also fail if
  3284.     modem-signal support is not included in C-Kermit for your particular
  3285.     operating system version.  The modem signals are: CD (carrier detect), CTS
  3286.     (Clear To Send), and DSR (Data Set Ready).
  3287.  
  3288. Example:
  3289.  
  3290.     wait 10 cd dsr      ; Wait 5 seconds for CD and DSR.
  3291.     if success goto ok  ; Test the result.
  3292.  
  3293. WAIT can be interrupted by typing Ctrl-C (or any other character), in which
  3294. case it fails.
  3295.  
  3296. The behavior of the INPUT command can be controlled by SET INPUT:
  3297.  
  3298. SET [ INPUT ] CASE {IGNORE, OBSERVE}
  3299.     Tells whether alphabetic case matters when searching the remote computer's
  3300.     responses for the INPUT text.  This setting also affects C-Kermit's other
  3301.     string comparison operations, including IF EQUAL, IF LGT, etc (IF command
  3302.     described later).
  3303.  
  3304. SET INPUT ECHO { ON, OFF }
  3305.     Tells whether the characters read by the INPUT command should be echoed on
  3306.     the screen.
  3307.  
  3308. SET INPUT TIMEOUT-ACTION { PROCEED, QUIT }
  3309.     Tells whether the script program should continue or stop immediately if an
  3310.     INPUT command fails.
  3311.  
  3312. At this point Kermit needs a decision making mechanism to tell whether the
  3313. INPUT command succeeded or failed.  This is the IF command.  Note that IF can
  3314. be used after INPUT only if you SET INPUT TIMEOUT PROCEED.
  3315.  
  3316. IF [NOT] condition command
  3317.     If the condition is satisfied, execute the following Kermit command.  If
  3318.     the word NOT is included, execute the command if the condition is not
  3319.     satisfied.  Only one command may be given, and it must appear on the same
  3320.     line as the IF.
  3321.  
  3322. The IF command supports a wide variety of conditions.  These are:
  3323.  
  3324.     IF SUCCESS
  3325.         The previous command succeeded.
  3326.  
  3327.  
  3328.     IF FAILURE
  3329.         The previous command failed.
  3330.  
  3331.  
  3332.     IF DEFINED name
  3333.         The named variable or macro is defined.
  3334.  
  3335.  
  3336.     IF BACKGROUND
  3337.         Kermit is running in the background or with its standard input and
  3338.         output redirected.
  3339.  
  3340.  
  3341.     IF COUNT
  3342.         Subtract one from COUNT, execute the command if the result is greater
  3343.         than zero (see SET COUNT).
  3344.  
  3345.  
  3346.     IF EXIST filename
  3347.         The named file exists.
  3348.  
  3349.  
  3350.     IF NUMERIC variable
  3351.         The variable's value is numeric.
  3352.  
  3353.  
  3354.     IF EQUAL s1 s2
  3355.         s1 and s2 (character strings or variables) are equal.
  3356.  
  3357.  
  3358.     IF LLT s1 s2
  3359.         s1 is lexically (alphabetically) less than s2.  Use IF NOT LGT for
  3360.         less-than-or-equal.
  3361.  
  3362.  
  3363.     IF LGT s1 s1
  3364.         s1 is lexically (alphabetically) greater than s2.  Use IF NOT LLT for
  3365.         greater-than-or-equal.
  3366.  
  3367.  
  3368.     IF = n1 n2
  3369.         n1 and n2 (numbers or variables containing numbers) are equal.
  3370.  
  3371.  
  3372.     IF < n1 n2
  3373.         n1 is arithmetically less than n2. Use IF NOT > for less-than-or-equal.
  3374.  
  3375.  
  3376.     IF > n1 n2
  3377.         n1 is arithmetically greater than n2\n.  Use IF NOT < for greater-than-
  3378.         or-equal.
  3379.  
  3380. String comparisons in IF EQUAL, IF LGT, and IF LLT treat alphabetic case
  3381. according to SET INPUT CASE {IGNORE, OBSERVE}.  You can also use \fupper() and
  3382. \flower() to force caseless comparisons if INPUT CASE is set to OBSERVE.
  3383.  
  3384. Arithmetic comparisons work with numeric constants, variables and array
  3385. elements that evaluate to a numeric string, functions that return a numeric
  3386. value, and the special "MS-DOS Kermit compatibility" variables COUNT, VERSION,
  3387. and ARGC, which can only appear in this context.  Numeric strings are converted
  3388. to binary integers before comparison, and may be positive, zero, or negative.
  3389. Floating point ("real") numbers are not supported.
  3390.  
  3391. The IF command may be followed on the next line by an ELSE command, which is
  3392. executed if the IF condition is not true, and which is not executed if the IF
  3393. condition is true.  Example:
  3394.  
  3395.     IF < \%x 10 ECHO It's less
  3396.     ELSE echo It's not less
  3397.  
  3398. As in any programming language, it is desirable to be able to go to different
  3399. places in the program based on the decisions made by IF commands.  The command
  3400. for going-to is:
  3401.  
  3402. GOTO label
  3403.     Go to the command which follows the named label.
  3404.  
  3405. A label is a word beginning with a colon (:) on the left margin.  Example:
  3406.  
  3407.     IF < \%x 10 goto less
  3408.     echo It's not less
  3409.     goto fin
  3410.     :less
  3411.     ECHO It's less
  3412.     :fin
  3413.  
  3414. Several other commands are especially useful in conditional contexts, i.e. as
  3415. objects of IF commands:
  3416.  
  3417. STOP
  3418.     Stop executing the current script program (TAKE file or macro) and return
  3419.     immediately to C-Kermit prompt level (or, if Kermit was invoked with
  3420.     command-line action arguments, exit C-Kermit altogether).
  3421.  
  3422. END [ n ]
  3423.     Go "up" one command level.  Exit the currently executing macro or TAKE
  3424.     file, and return to the invoking TAKE file or macro.  Or, if the current
  3425.     TAKE file or macro was invoked from C-Kermit> prompt level, return to the
  3426.     prompt.  Or, if Kermit was invoked with command-line action arguments, exit
  3427.     C-Kermit.  If a value is given, it is used to set the SUCCESS flag (if the
  3428.     value is zero) or the FAILURE flag (if the value is nonzero).  You can use
  3429.     POP as a synonym for this command.
  3430.  
  3431. RETURN [value]
  3432.     For use within macros.  Just like END, except that a return value may be
  3433.     set.  This is for use with the \fexecute() function, which allows you to
  3434.     write user-defined functions.  For example:
  3435.  
  3436.         def sum if = \%1 1 return 1,-
  3437.           else return \feval(\%1 + \fexecute(sum \feval(\%1 - 1)))
  3438.  
  3439.     This function, called SUM, returns the sum of all the numbers from 1 to
  3440.     whatever number (1 or greater) it was called with, for example:
  3441.  
  3442.         echo \fexec(sum 5)
  3443.  
  3444.     prints the number 15.  Notice that this function calls itself; C-Kermit
  3445.     functions are allowed to do this.
  3446.  
  3447. Although the object command of an IF or ELSE statement may only be a single
  3448. command, that command is allowed to be a macro invocation or a TAKE command.
  3449. This provides a kind of statement grouping that can be used to avoid a lot of
  3450. confusing GOTOs.  A more flexible kind of statement grouping is available in
  3451. the XIF ("extended IF") command:
  3452.  
  3453. XIF condition { command-list } [ ELSE { command-list } ]
  3454.     In this extended form, braces are required to enclose a comma-separated
  3455.     list of one or more commands, and the ELSE clause is on the same line as
  3456.     the XIF.  Example:
  3457.  
  3458.         xif < \%x 10 {ech Less,def \%m 10} else {ec Not less,def \%m \%x}
  3459.  
  3460.     Here the appropriate message is echoed, depending on the value of \%x, and
  3461.     the minimum of \%x and 10 is assigned to the variable \%m.  Commands like
  3462.     this one can be broken onto multiple lines for clarity, but only if you use
  3463.     dash (or backslash) for line continuation:
  3464.  
  3465.         xif < \%x 10 { -
  3466.             echo Less, -
  3467.             def \%m 10 -
  3468.         } else { -
  3469.             echo Not less, -
  3470.             def \%m \%x -
  3471.         }
  3472.  
  3473. WARNING: RETURN or END statements should not be used within an XIF command.
  3474.  
  3475.  
  3476. Other Ways of Assigning Values to Variables
  3477.  
  3478. Sometimes it is desirable for a script program to interact with you as well as
  3479. with the remote computer.  For example, you should not store passwords on disk,
  3480. so you can't write script programs that contain them.  However, you can write
  3481. script programs that prompt you for your password.  This is done using the ASK
  3482. or ASKQ command:
  3483.  
  3484. ASK name prompt
  3485.     Print the prompt on the screen and wait for you to type a line of text
  3486.     (terminated by carriage return), and assign this line of text to the named
  3487.     variable (but without the carriage return), for example:
  3488.  
  3489.         ask \%p Password:
  3490.         output \%p\13
  3491.  
  3492.     The prompt may be enclosed in { curly braces } to retain leading and/or
  3493.     trailing spaces.
  3494.  
  3495. ASKQ name prompt
  3496.     Just like ASK, but it "asks quietly".  The characters you type do not echo.
  3497.     Especially useful for passwords.
  3498.  
  3499. GETOK text
  3500. Asks a "yes or no" question.  The text is the question.  Enclose it in curly
  3501. braces to preserve leading or trailing spaces.  If the user replies "Yes" or
  3502. "OK" (or any abbreviation of these), the SUCCESS flag is set (for IF SUCCESS).
  3503. If she replies "N" or "No", the FAILURE flag is set.
  3504.  
  3505. Now, with IF, branching, ASK, and so forth, we can add to our login script:
  3506.  
  3507.     define error echo Error: \%1, end   ; Error-handling macro.
  3508.     set input timeout proceed           ; Don't quit if INPUT fails.
  3509.     set input case ignore               ; Alphabetic case doesn't matter.
  3510.     set input echo off                  ; Don't need to watch.
  3511.     output \13                          ; Send carriage return (ASCII 13).
  3512.     input 5 login:                      ; Wait 5 secs for "login:" prompt.
  3513.     if fail error {No login prompt}     ; Give up if it doesn't come.
  3514.     output myuserid\13                  ; Send user ID followed by CR.
  3515.     input 5 password:                   ; Wait for password prompt.
  3516.     if fail error {No password prompt}  ; Give up if it doesn't come.
  3517.     ask \%p Password:                   ; Prompt user for password
  3518.     output \%p\13                       ; Send it, followed by CR
  3519.     input 30 $\32                       ; Wait for system prompt "$ "
  3520.     if fail error {No system prompt}    ; Give up if it doesn't come.
  3521.     connect                             ; Got it, connect.
  3522.  
  3523.  
  3524. Reading and Writing Local Files
  3525.  
  3526. It is also possible to assign data from local files to variables.  In fact,
  3527. C-Kermit includes an entire input and output system for local files and
  3528. commands:
  3529.  
  3530. OPEN mode filename
  3531.     For use with READ and WRITE commands.  Open the local file in the specified
  3532.     mode: READ, WRITE, or APPEND.  !READ and !WRITE mean to read from or write
  3533.     to a system command rather than a file.  Examples:
  3534.  
  3535.         OPEN READ oofa.txt
  3536.         OPEN !READ ls ck[uwc].[cwh]
  3537.  
  3538.     The first example reads lines from the file oofa.txt.  The second reads
  3539.     filenames from a UNIX directory listing; this gives you a way to select
  3540.     files using your UNIX shell's filename-matching metacharacters, which are
  3541.     more powerful than Kermit's built-in ones.
  3542.  
  3543. READ name
  3544.     The next line from the current OPEN READ or OPEN !READ file is assigned to
  3545.     the named variable, for example READ \%A.  If no more lines remain in the
  3546.     file, the command fails.
  3547.  
  3548. WRITE name text
  3549.     Writes the given text to the named log or file.  The text text may include
  3550.     backslash codes, and is not terminated by a newline unless you include the
  3551.     appropriate code.  The name parameter can be any of the following:
  3552.  
  3553.     DEBUG-LOG
  3554.     FILE (the OPEN WRITE, OPEN !WRITE, or OPEN APPEND file).
  3555.     PACKET-LOG
  3556.     SCREEN (just like ECHO except that WRITE does not supply a line terminator)
  3557.     SESSION-LOG
  3558.     TRANSACTION-LOG
  3559.  
  3560. CLOSE name
  3561.     Closes the named file.  A READ or !READ file is closed automatically when
  3562.     end-of-file (EOF) is encountered during a READ operation, but it does no
  3563.     harm to close it again.  WRITE, !WRITE, and APPEND files must be closed
  3564.     explicitly.  Examples: CLOSE READ, CLOSE WRITE.
  3565.  
  3566. A typical script program for reading and writing files might look like this:
  3567.  
  3568.     set take error off                  ; So EOF can be handled.
  3569.     open read foo                       ; Open input file "foo".
  3570.     open write bar                      ; Open output file "bar".
  3571.     def \%c 0                           ; Make a line counter.
  3572.     :loop                               ; Loop to read all lines.
  3573.     read \%a                            ; Read one line into \%a.
  3574.     if fail goto done                   ; Catch EOF this way.
  3575.     increment \%c                       ; Count the line.
  3576.     write file \%c. \fupp(\%a)\10       ; Format and write it.
  3577.     goto loop                           ; Go back and get more.
  3578.     :done
  3579.     close read                          ; Finished,
  3580.     close write                         ; close the files.
  3581.     echo All done.                      ; Print a message.
  3582.  
  3583. The previous example shows a loop, which is a common programming construct.  It
  3584. is always desirable to avoid infinite loops.  The READ example does this by
  3585. testing for end of file (EOF) with IF FAILURE.
  3586.  
  3587.  
  3588. Counted Loops
  3589.  
  3590. Kermit also provides for "finite", or counted, loops, in several varieties:
  3591.  
  3592. SET COUNT / IF COUNT
  3593.     Here a special variable, COUNT, is set.  The IF COUNT command decrements
  3594.     the count variable, and if the result is greater than zero, executes the
  3595.     object command:
  3596.  
  3597.         set count 5
  3598.         :loop
  3599.         echo \v(count)
  3600.         if count goto loop
  3601.         else echo Zero!
  3602.  
  3603. FOR variable iv fv step { command, command, ... }
  3604.     The FOR loop is controlled by a loop variable which is assigned an initial
  3605.     value (iv), gets tested against a final value (fv), and gets incremented by
  3606.     a step value.  If the step value is positive, the loop exits when the loop
  3607.     variable is greater than the final value.  If the step is negative, the
  3608.     loop exits when the variable becomes less than the final value.  Example
  3609.     (cute way to print the 9's times table):
  3610.  
  3611.         for \%i 0 9 1 { assign \%j \feval(9-\%i), echo \%i\%j }
  3612.  
  3613.     FOR loops can be nested:
  3614.  
  3615.         for \%i 1 5 1 { for \%j 5 \%i -1 { echo \%i:\%j } }
  3616.  
  3617. WHILE condition { command, command, ... }
  3618.     The commands are executed as long as the condition is true.  The conditions
  3619.     are the same as for the IF command.  Example:
  3620.  
  3621.         while not exist foo.bar { sleep 1 }
  3622.  
  3623.     This loop waits until file named foo.bar appears.
  3624.  
  3625. FOR and WHILE loops can be nested in any combination.  Both FOR and WHILE loops
  3626. may be exited or continued prematurely using the following commands:
  3627.  
  3628. BREAK
  3629.     Exit from the closest enclosing FOR or WHILE loop.
  3630.  
  3631. CONTINUE
  3632.     Begin the next iteration (if any) of the closest enclosing FOR or WHILE
  3633.     loop immediately.
  3634.  
  3635. WARNING: RETURN and END commands should not be used in the object commands of
  3636. FOR, WHILE, or XIF.
  3637.  
  3638. Here's a script program example that has nothing to do with data communication
  3639. or file transfer, but which illustrates the control structures of the script
  3640. language, the use of arrays, statement grouping, file i/o, etc:
  3641.  
  3642.     ; Kermit script program to read a file of numbers into an array,
  3643.     ; sort the array numerically, and display the sorted result.
  3644.     ;
  3645.     def \%d 100                   ; Allow up to 100 elements.
  3646.     dcl &a[\%d]                   ; Declare a 100-element array.
  3647.     set take error off            ; To handle EOF on READ.
  3648.     open read numbers.dat         ; Open this file for reading.
  3649.  
  3650.     ; Read each line into a separate array element
  3651.     ;
  3652.     echo Reading...
  3653.     for \%n 1 \%d 1 { -
  3654.         read \&a[\%n], -
  3655.         if fail break -
  3656.     }
  3657.     decr \%n                      ; Subtract one for read that failed.
  3658.                                   ; Check for too many lines.
  3659.     xif > \%n \%d { -
  3660.         echo Too many lines in file, -
  3661.         stop -
  3662.     }
  3663.     echo Array initialized: \%n elements, sorting...
  3664.  
  3665.     ; Sort the array using the (slow) "bubble sort" algorithm.
  3666.     ;
  3667.     assign \%m \feval(\%n-1)
  3668.     for \%i 1 \%m 1 { -
  3669.         for \%j \%i \%n 1 { -
  3670.             xif > \&a[\%i] \&a[\%j] { -
  3671.                 assign \%t \&a[\%i], -
  3672.                 assign \&a[\%i] \&a[\%j], -
  3673.                 assign \&a[\%j] \%t -
  3674.             } -
  3675.         } -
  3676.     }
  3677.  
  3678.     ; Display the sorted array.
  3679.     ;
  3680.     echo sorted.
  3681.     for \%i 1 \%n 1 { echo \flpad(\%i,3). \flpad(\&a[\%i],5) }
  3682.  
  3683. 1.14. The SCRIPT Command
  3684.  
  3685. The SCRIPT command allows connection and login sequences to be specified in a
  3686. single, cryptic line in the style of the UNIX uucp L.sys file.
  3687.  
  3688. Syntax: SCRIPT expect send [expect send] . . .
  3689.  
  3690. "expect" has the syntax: expect[-send-expect[-send-expect[...]]]
  3691.  
  3692. The SCRIPT command carries on a "canned dialog" with a remote system, in which
  3693. data is sent according to the remote system's responses.  The typical use is
  3694. for logging in to a remote system automatically.
  3695.  
  3696. A login script is a sequence of the form:
  3697.  
  3698.     expect send [expect send] . . .
  3699.  
  3700. where expect is a prompt or message to be issued by the remote site, and send
  3701. is the string (names, numbers, etc) to return, and expects are separated from
  3702. sends by spaces.  The send may also be the keyword EOT, to send Control-D, or
  3703. BREAK, to send a break signal.  Letters in sends may be prefixed by `~' to send
  3704. special characters, including:
  3705.  
  3706.     ~b  backspace
  3707.     ~s  space
  3708.     ~q  `?'(trapped by Kermit's command interpreter)
  3709.     ~n  linefeed
  3710.     ~r  carriage return
  3711.     ~t  tab
  3712.     ~'  single quote
  3713.     ~-  dash (hyphen)
  3714.     ~~  tilde itself
  3715.     ~"  double quote
  3716.     ~x  XON (Control-Q)
  3717.     ~c  don't append a carriage return
  3718.     ~o[o[o]]  octal representation of an ASCII character code
  3719.     ~d  delay approx 1/3 second during send
  3720.     ~w[d[d]]  wait specified interval during expect, then time out
  3721.     \\b send a BREAK signal
  3722.  
  3723. As with some UUCP systems, sent strings are followed by ~r unless they have a
  3724. ~c.
  3725.  
  3726. Only the last 7 characters in each expect are matched.  A null expect, e.g. ~0
  3727. or two adjacent dashes, causes a short delay before proceeding to the next send
  3728. sequence.  A null expect always succeeds.
  3729.  
  3730. As with UUCP, if the expect string does not arrive, the script attempt fails.
  3731. If you expect that a sequence might not arrive, as with UUCP, conditional
  3732. sequences may be expressed in the form:
  3733.  
  3734.     -send-expect[-send-expect[...]]
  3735.  
  3736. where dashed sequences are followed as long as previous expects fail.  Timeouts
  3737. for expects can be specified using ~w; ~w with no arguments waits 15 seconds.
  3738.  
  3739. expect-send transactions can be easily be debugged by logging transactions.
  3740. This records all exchanges, both expected and actual.  The script execution
  3741. will also be logged in the session log, if that is activated.
  3742.  
  3743. Note that `\' characters in login scripts, as in any other C-Kermit interactive
  3744. commands, must be doubled up.  A line may be ended with a single `\' for
  3745. continuation.
  3746.  
  3747. Example one:
  3748.  
  3749. Using a modem, dial a UNIX host site.  Expect "login" (...gin), and if it
  3750. doesn't come, simply send a null string with a ~r.  (Some UNIXes require either
  3751. an EOT or a BREAK instead of the null sequence, depending on the particular
  3752. site's "logger" program.)  After providing user id and password, respond "x" to
  3753. a question-mark prompt, expect the Bourne shell "$" prompt (and send return if
  3754. it doesn't arrive).  Then cd to directory kermit, and run the program called
  3755. "wermit", entering the interactive connect state after wermit is loaded.
  3756.  
  3757.     set modem ventel
  3758.     set line /dev/tty77
  3759.     set baud 1200
  3760.     dial 9&5551212
  3761.     script gin:--gin:--gin: smith ssword: mysecret ~q x $--$ \
  3762.      cd~skermit $ wermit
  3763.     connect
  3764.  
  3765. Note that SET LINE is issued after SET MODEM, but before SET BAUD or other
  3766. line-related parameters.
  3767.  
  3768. Example two:
  3769.  
  3770. Using a modem, dial the Telenet network.  This network expects three returns
  3771. with slight delays between them.  These are sent following null expects.  The
  3772. single return is here sent as a null string, with a return appended by default.
  3773. Four returns are sent to be safe before looking for the prompt.  Then the
  3774. Telenet id and password are entered.  Then Telenet is instructed to connect to
  3775. a host site (c 12345).  The host has a data switch that asks "which system";
  3776. the script responds "myhost" (if the "which system" prompt doesn't appear, the
  3777. Telenet connect command is reissued).  The script waits for an "@" prompt from
  3778. the host, then sends the user ID ("joe") and password ("secret"), looks for
  3779. another "@" prompt, runs Kermit, and in response to the Kermit's prompt (which
  3780. ends in ">"), gives the commands "set parity even" and "server".  Files are
  3781. then exchanged.  The commands are in a take file; note the continuation of the
  3782. 'script' command onto several lines using the `\' terminator.
  3783.  
  3784.     set modem hayes
  3785.     set line /dev/acu
  3786.     set speed 1200
  3787.     set parity mark
  3788.     dial 9,5551212
  3789.     script ~0 ~0 ~0 ~0 ~0 ~0 ~0 ~0 @--@--@ id~s\
  3790.     aa001122 = 002211 @ c~s12345 ystem-c~s12345-ystem \
  3791.     myhost @ joe~ssecret @ kermit > set~sparity~seven > server
  3792.     send some.stuff
  3793.     get some.otherstuff
  3794.     bye
  3795.     quit
  3796.  
  3797. Since these commands may be executed totally in the background, they can also
  3798. be scheduled.  A typical shell script, which might be scheduled by cron, would
  3799. be as follows (csh used for this example):
  3800.  
  3801.     #
  3802.     # Keep trying to dial and log onto remote host and exchange
  3803.     # files, wait 10 minutes before retrying if it fails.
  3804.     #
  3805.     cd someplace
  3806.     while ( 1 )
  3807.         kermit < ./tonight.cmd >> nightly.log &
  3808.         if ( ! $status ) break
  3809.         sleep 600
  3810.     end
  3811.  
  3812. File tonight.cmd might have two takes in it, for example, one to take a file
  3813. with the set modem, set line, set baud, dial, and script, and a second take of
  3814. a file with send/get commands for the remote server.  The last lines of
  3815. tonight.cmd should be BYE and QUIT.
  3816.  
  3817.  
  3818. 1.15. Command Line Operation
  3819.  
  3820. A subset of Kermit's commands is available using UNIX-style command line
  3821. options, on operating systems that support passing of command-line options to
  3822. programs through the "argv, argc" mechanism.
  3823.  
  3824. The C-Kermit command line syntax mostly conforms to the Proposed Syntax
  3825. Standards for UNIX System Commands put forth by Kathy Hemenway and Helene
  3826. Armitage of AT&T Bell Laboratories in UNIX/World, Vol.1, No.3, 1984.  The rules
  3827. that apply are:
  3828.  
  3829.    - Command names must be between 2 and 9 characters ("kermit" is 6).
  3830.    - Command names must include lower case letters and digits only.
  3831.    - An option name is a single character.
  3832.    - Options are delimited by '-'.
  3833.    - Options with no arguments may be grouped (bundled) behind one
  3834.      delimiter.
  3835.    - Option-arguments cannot be optional.
  3836.    - Arguments immediately follow options, separated by whitespace.
  3837.    - The order of options does not matter.
  3838.    - '-' preceded and followed by whitespace means standard input.
  3839.  
  3840. A group of bundled options may end with an option that has an argument.
  3841.  
  3842. The following notation is used in command descriptions:
  3843.  
  3844.     fn  A file specification, possibly containing the "wildcard" characters `*'
  3845.         or `?' (`*' matches all character strings, `?'  matches any single
  3846.         character).
  3847.  
  3848.  
  3849.     fn1 A UNIX file specification which may not contain `*' or `?'.
  3850.  
  3851.  
  3852.     rfn A remote file specification in the remote system's own syntax, which
  3853.         may denote a single file or a group of files.
  3854.  
  3855.  
  3856.     rfn1
  3857.         A remote file specification which should denote only a single file.
  3858.  
  3859.  
  3860.     n   A decimal number between 0 and 94.
  3861.  
  3862.  
  3863.     c   A decimal number between 0 and 127 representing the value of an ASCII
  3864.         character.
  3865.  
  3866.  
  3867.     cc  A decimal number between 0 and 31, or else exactly 127, representing
  3868.         the value of an ASCII control character.
  3869.  
  3870.  
  3871.     [ ] Any field in square braces is optional.
  3872.  
  3873.  
  3874.     {x,y,z}
  3875.         Alternatives are listed in curly braces.
  3876.  
  3877. C-Kermit command line options may specify any combination of actions and
  3878. settings.  If C-Kermit is invoked with a command line that specifies no
  3879. actions, then it will issue a prompt and begin interactive dialog.  Action
  3880. options specify either protocol transactions or terminal connection.
  3881.  
  3882. An implicit TAKE command is executed upon your C-Kermit initialization file
  3883. when C-Kermit starts up, upon either interactive or command-line invocation.
  3884. This file may contain C-Kermit interactive-mode commands, which are explained
  3885. later.
  3886.  
  3887. In addition, if the first command line argument is the name of an existing
  3888. file, C-Kermit will read that file and execute Kermit interactive-mode commands
  3889. from it, in addition to (and after) your initialization file (if any).
  3890. Example:
  3891.  
  3892.     $ kermit cmdfile -b 3 -p m
  3893.  
  3894. In UNIX, this feature allows you to invoke C-Kermit by "running" a C-Kermit
  3895. command file, if its first line is of the form:
  3896.  
  3897.     #!/dir/kermit
  3898.  
  3899. That is, number sign followed by exclamation point, followed by the full file
  3900. specification of the Kermit program.  You must also give this file execute
  3901. permission:
  3902.  
  3903.     $ chmod +x cmdfile
  3904.  
  3905. Then you can run this file as if it were a program, and it will feed itself to
  3906. C-Kermit automatically:
  3907.  
  3908.     $ cmdfile
  3909.  
  3910. You can even include C-Kermit command line options:
  3911.  
  3912.     $ cmdfile -l /dev/ttyh8 -p e
  3913.  
  3914. If you want the shell prompt to return automatically at the end of this file,
  3915. include an EXIT command at the end of it.  Otherwise you will receive the
  3916. C-Kermit prompt when the file is finished.
  3917.  
  3918. Here are C-Kermit's command-line options:
  3919.  
  3920.     =   Ignore all command-line options that follow (but make them available to
  3921.         the user in the array \&@[]).
  3922.  
  3923.  
  3924.     -Y  (uppercase) Do not execute commands from the initialization file.
  3925.  
  3926.  
  3927.     -y fn
  3928.         Read commands from the specified file instead of the normal
  3929.         initialization file.
  3930.  
  3931.  
  3932.     -C "command, command, ..."
  3933.         Execute the interactive-mode commands after the initialization file (if
  3934.         any), the other command-line options (if any), and the command or
  3935.         application file (if any).  The command list must be enclosed in double
  3936.         quotes.  Example:
  3937.  
  3938.             kermit -C "set file type binary, set window 2"
  3939.  
  3940.         The commands in this list are assigned to a macro called cl_commands,
  3941.         so you can also execute them later during your session simply by typing
  3942.         the name of this macro:
  3943.  
  3944.             C-Kermit>cl_commands
  3945.  
  3946.         The -C option does is not considered an "action" option, even if the
  3947.         command list contains action commands, so if there are no other action
  3948.         commands among the command-line arguments, the C-Kermit prompt appears
  3949.         after the last command in the list is executed.  To defeat this
  3950.         behavior, include EXIT as the last command:
  3951.  
  3952.             kermit -C "echo \27[2J\27H, exit"
  3953.  
  3954.  
  3955.  
  3956.     -S  ("Stay") This option tells C-Kermit to issue its prompt and enter
  3957.         interactive command mode, even if the command-line options included
  3958.         action commands.
  3959.  
  3960. These are the file-transfer commands:
  3961.  
  3962.     -s fn
  3963.         Send the specified file or files.  If fn contains wildcard (meta)
  3964.         characters, the UNIX shell expands it into a list.  On non-UNIX
  3965.         systems, Kermit expands any wildcard characters.  fn may also be a list
  3966.         of files, as in:
  3967.  
  3968.             kermit -s ckcmai.c ckuker.h mail.txt
  3969.  
  3970.         If fn is '-' then kermit sends from standard input, which may come from
  3971.         a file:
  3972.  
  3973.             kermit -s - < foo.bar
  3974.  
  3975.         or a parallel process:
  3976.  
  3977.             ls -l | grep cmg | kermit -s -
  3978.  
  3979.         You cannot use this mechanism to send terminal typein.  If you want to
  3980.         send a file whose actual name is "-" you can precede it with a path
  3981.         name, as in
  3982.  
  3983.             kermit -s ./-
  3984.  
  3985.  
  3986.  
  3987.     -r  Receive a file or files.  Wait passively for files to arrive.
  3988.  
  3989.  
  3990.     -k  Receive (passively) a file or files, sending them to standard output.
  3991.         This option can be used in several ways:
  3992.  
  3993.         kermit -k
  3994.             Displays the incoming files on your screen; to be used only in
  3995.             "local mode" (see below).
  3996.  
  3997.  
  3998.         kermit -k > fn1
  3999.             Sends the incoming file or files to the named file, fn1.  If more
  4000.             than one file arrives, all are concatenated together into the
  4001.             single file fn1.
  4002.  
  4003.  
  4004.         kermit -k | command
  4005.             Pipes the incoming data (single or multiple files) to the indicated
  4006.             command, as in
  4007.  
  4008.                 kermit -k | sort > sorted.stuff
  4009.  
  4010.  
  4011.  
  4012.     -a fn1
  4013.         If you have specified a file transfer option, you may give an alternate
  4014.         name for a single file with the -a ("as") option.  For example,
  4015.  
  4016.             kermit -s foo -a bar
  4017.  
  4018.         sends the file foo telling the receiver that its name is bar.  If more
  4019.         than one file arrives or is sent, only the first file is affected by
  4020.         the -a option:
  4021.  
  4022.             kermit -ra baz
  4023.  
  4024.         stores the first incoming file under the name baz.
  4025.  
  4026.  
  4027.     -x  Begin server operation.  May be used in either local or remote mode.
  4028.  
  4029. Before proceeding, a few words about remote and local operation are necessary.
  4030. C-Kermit is "local" if it is running on PC or workstation that you are using
  4031. directly, or if it is running on a multiuser system and transferring files over
  4032. an external communication line -- not your job's controlling terminal or
  4033. console.  C-Kermit is remote if it is running on a multiuser system and
  4034. transferring files over its own controlling terminal's communication line
  4035. (normally /dev/tty), connected to your PC or workstation.
  4036.  
  4037. If you are running C-Kermit on a PC, it is normally used in local mode, with
  4038. the "back port" designated for file transfer and terminal connection, and the
  4039. keyboard and screen available to control or interrupt the file transfer and to
  4040. display its status.  If you are running C-Kermit on a multiuser (timesharing)
  4041. system, it is in remote mode unless you explicitly point it at an external line
  4042. for file transfer or terminal connection.  The following command determines
  4043. whether C-Kermit is in local or remote mode:
  4044.  
  4045.     -l dev
  4046.         Line -- Specify a terminal line to use for file transfer and terminal
  4047.         connection, as in:
  4048.  
  4049.             kermit -l /dev/ttyi5
  4050.  
  4051.         You can also give an open file descriptor for a serial communication
  4052.         (tty) device.
  4053.  
  4054. When an external line is being used, you will also need some additional options
  4055. for successful communication with the remote system:
  4056.  
  4057.     -b n
  4058.         Bits per second -- Specify the transmission speed in bits per second
  4059.         ("baud rate") for the line given in the -l option, as in:
  4060.  
  4061.             kermit -l /dev/ttyi5 -b 9600
  4062.  
  4063.         This option should always be included with the -l option, since the
  4064.         speed of an external line is not necessarily what you expect.
  4065.  
  4066.  
  4067.     -p x
  4068.         Parity -- e,o,m,s,n (even, odd, mark, space, or none).  If parity is
  4069.         other than none, then Kermit's 8th-bit prefixing mechanism will be used
  4070.         for transferring 8-bit binary data, provided the opposite Kermit
  4071.         agrees.  The default parity is none.
  4072.  
  4073.  
  4074.     -t  Specifies half duplex, line turnaround with XON as the handshake
  4075.         character, used mainly for communicating with IBM mainframes in
  4076.         linemode.
  4077.  
  4078.  
  4079.     -mname
  4080.         Modem type -- hayes, penril, vadic, etc.  For a complete and up-to-date
  4081.         list, run C-Kermit interactively and type "set modem ?".  Note:  name
  4082.         must be given in lowercase, but can be abbreviated, e.g. "hay" for
  4083.         "hayes".
  4084.  
  4085. If you wish to use a network connection rather than a terminal line for
  4086. communication, use the following options rather -l:
  4087.  
  4088.     -j name
  4089.         Host -- Specify a network host name.  This option is currently
  4090.         supported for TCP/IP Telnet connections on Berkeley-based UNIX
  4091.         implementations only, and for VAX/VMS when equipped with TGV MultiNet
  4092.         TCP/IP.  The speed (-b) parameter does not apply to network
  4093.         connections.  The name can be an IP host name, an IP host number
  4094.         (containing dots), or either one of these followed by a colon and then
  4095.         a TCP service name or number.  It can also be just a number, in which
  4096.         case it is assumed to be a file descriptor for an open TCP/IP TELNET
  4097.         connection.
  4098.  
  4099.  
  4100.     -X address
  4101.         X.25 address -- Specify an X.25 network address.
  4102.  
  4103.  
  4104.     -Z number
  4105.         X.25 file descriptor -- Specify a file descriptor for an X.25
  4106.         connection that is already open.
  4107.  
  4108. The following commands may be used only with a C-Kermit which is in local mode.
  4109.  
  4110.     -g rfn
  4111.         Actively request a remote server to send the named file or files; rfn
  4112.         is a file specification in the remote host's own syntax.  If fn happens
  4113.         to contain any special shell characters, like space, '*', '[', '~',
  4114.         etc, these must be quoted, as in:
  4115.  
  4116.             kermit -g x\*.\?
  4117.  
  4118.         or:
  4119.  
  4120.             kermit -g "profile exec"
  4121.  
  4122.  
  4123.  
  4124.     -f  Send a 'finish' command to a remote server.
  4125.  
  4126.  
  4127.     -c  Establish a terminal connection over the specified or default
  4128.         communication line, before any protocol transaction takes place.  Get
  4129.         back to the local system by typing the escape character (normally
  4130.         Control-Backslash) followed by the letter 'c'.
  4131.  
  4132.  
  4133.     -n  Like -c, but after a protocol transaction takes place; -c and -n may
  4134.         both be used in the same command.  The use of -n and -c is illustrated
  4135.         below.
  4136.  
  4137. If the other Kermit is on a remote system, the -l and -b options should also be
  4138. included with the -r, -k, or -s options.
  4139.  
  4140. Several other command-line options are provided:
  4141.  
  4142.     -i  Specifies that files should be sent or received exactly "as is" with no
  4143.         conversions.  This option is necessary for transmitting binary files.
  4144.         It may also be used in UNIX-to-UNIX transfers (it must be given to both
  4145.         UNIX Kermit programs), where it will improve performance by
  4146.         circumventing the normal text-file conversions, and will allow mixture
  4147.         of text and binary files in a single file group.  But only use it if
  4148.         character-set translation is not needed.
  4149.  
  4150.  
  4151.     -w  Writeover -- An incoming file should write over any existing file of
  4152.         the same name.  Changes the default behavior, which is to back up the
  4153.         existing file before creating the new one.
  4154.  
  4155.  
  4156.     -e n
  4157.         Extended packet length -- Specify that C-Kermit is allowed to receive
  4158.         packets up to length n, where n may be between 10 and some large
  4159.         number, like 1000 or 2000, depending on the system.  The default
  4160.         maximum length for received packets is 90.  Packets longer than 94 will
  4161.         be used only if the other Kermit supports, and agrees to use, the "long
  4162.         packet" protocol extension, and if you request them.
  4163.  
  4164.  
  4165.     -v n
  4166.         Window size -- Specify that C-Kermit is allowed to send and receive
  4167.         files using a window size of n.  That is, up to n packets may be sent
  4168.         before acknowledgements are required.  This speeds up transfers in most
  4169.         situations, especially long distance network connections.  Default
  4170.         window size is 1, maximum is 32.  Sizes greater than 1 work only if the
  4171.         other Kermit supports this option.
  4172.  
  4173.  
  4174.     -q  Quiet -- Suppress screen update during file transfer, for instance to
  4175.         allow a file transfer to proceed in the background.
  4176.  
  4177.  
  4178.     -z  Force foreground mode: even if Kermit thinks it is running in the
  4179.         background, this will make it issue its normal prompts and messages.
  4180.         Example:
  4181.  
  4182.             kermit -z | vt100
  4183.  
  4184.  
  4185.  
  4186.     -d  Debug -- Record debugging information in the file debug.log in the
  4187.         current directory.  Use this option if you believe the program is
  4188.         misbehaving, and show the resulting log to your local Kermit
  4189.         maintainer.
  4190.  
  4191.  
  4192.     -h  Help -- Display a brief synopsis of the command line options.
  4193.  
  4194. The command line may contain no more than one protocol action option.
  4195.  
  4196. During transmission, files are encoded as follows:
  4197.  
  4198.    - Control characters are converted to prefixed printables.
  4199.  
  4200.    - Sequences of repeated characters are collapsed via repeat counts, if
  4201.      the other Kermit is also capable of repeated-character compression.
  4202.      This feature is negotiated automatically.
  4203.  
  4204.    - If parity is being used on the communication line, data characters
  4205.      with the 8th (parity) bit on are specially prefixed, provided the
  4206.      other Kermit is capable of 8th-bit prefixing; if not, 8-bit binary
  4207.      files cannot be successfully transferred.  This feature is negotiated
  4208.      if you give the -p option.
  4209.  
  4210.    - Conversion is done between UNIX newlines and carriage-return-linefeed
  4211.      sequences unless the -i option was specified.
  4212.  
  4213.  
  4214. Command Line Examples:
  4215.  
  4216.  
  4217.     kermit -l /dev/ttyi5 -b 1200 -cn -r
  4218.  
  4219. This command connects you to the system on the other end of ttyi5 at 1200 baud,
  4220. where you presumably log in and run Kermit with a SEND command.  After you
  4221. escape back, C-Kermit waits for a file (or files) to arrive.  When the file
  4222. transfer is completed, you are reconnected to the remote system so that you can
  4223. logout.
  4224.  
  4225.  
  4226.     kermit -l /dev/ttyi4 -b 1800 -cntp m -r -a foo
  4227.  
  4228. This command is like the preceding one, except the remote system in this case
  4229. uses half duplex communication with mark parity.  The first file that arrives
  4230. is stored under the name foo.
  4231.  
  4232.  
  4233.     kermit -l /dev/ttyi6 -b 9600 -c | tek
  4234.  
  4235. This example uses Kermit to connect your terminal to the system at the other
  4236. end of ttyi6.  The C-Kermit terminal connection does not provide any particular
  4237. terminal emulation, so C-Kermit's standard i/o is piped through a
  4238. (hypothetical) program called tek, which performs (say) Tektronix emulation.
  4239.  
  4240.  
  4241.     kermit -l /dev/ttyi6 -b 9600 -nf
  4242.  
  4243. This command would be used to shut down a remote server and then connect to the
  4244. remote system, in order to log out or to make further use of it.  The -n option
  4245. is invoked after -f (-c would have been invoked before).
  4246.  
  4247.  
  4248.     kermit -l /dev/ttyi6 -b 9600 -qg foo.\* &
  4249.  
  4250. This command causes C-Kermit to be invoked in the background, getting a group
  4251. of files from a remote server (note the quoting of the `*' character).  No
  4252. display occurs on the screen, and the keyboard is not sampled for interruption
  4253. commands.  This allows other work to be done while file transfers proceed in
  4254. the background.  UNIX only.
  4255.  
  4256.  
  4257.     kermit -l /dev/ttyi6 -b 9600 -g foo.\* > foo.log < /dev/null &
  4258.  
  4259. This command is like the previous one, except the file transfer display has
  4260. been redirected to the file foo.log.  Standard input is also redirected, to
  4261. prevent C-Kermit from sampling it for interruption commands.
  4262.  
  4263.  
  4264.     kermit -iwx
  4265.  
  4266. This command starts up C-Kermit as a server.  Files are transmitted with no
  4267. newline/carriage-return-linefeed conversion; the -i option is necessary for
  4268. binary file transfer and recommended for UNIX-to-UNIX transfers.  Incoming
  4269. files that have the same names as existing files are given new, unique names.
  4270.  
  4271.  
  4272.     kermit -l /dev/ttyi6 -b 9600
  4273.  
  4274. This command sets the communication line and speed.  Since no action is
  4275. specified, C-Kermit issues a prompt and enters an interactive dialog with you.
  4276. Any settings given on the command line remain in force during the dialog,
  4277. unless explicitly changed.
  4278.  
  4279.  
  4280.     kermit
  4281.  
  4282. This command starts up Kermit interactively with all default settings.
  4283.  
  4284. The next example shows how UNIX Kermit might be used to send an entire
  4285. directory tree from one UNIX system to another, using the tar program as
  4286. Kermit's standard input and output.  On the originating system, in this case
  4287. the remote, type (for instance):
  4288.  
  4289.  
  4290.     tar cf - /usr/fdc | kermit -is -
  4291.  
  4292. This causes tar to send the directory /usr/fdc (and all its files and all its
  4293. subdirectories and all their files...) to standard output instead of to a tape;
  4294. kermit receives this as standard input and sends it as a binary file.  On the
  4295. receiving system, in this case the local one, type (for instance):
  4296.  
  4297.  
  4298.     kermit -il /dev/ttyi5 -b 9600 -k | tar xf -
  4299.  
  4300. Kermit receives the tar archive, and sends it via standard output to its own
  4301. copy of tar, which extracts from it a replica of the original directory tree.
  4302.  
  4303. A final example shows how a UNIX compression utility might be used to speed up
  4304. Kermit file transfers:
  4305.  
  4306.     compress file | kermit -is -     (sender)
  4307.     kermit -ik | uncompress          (receiver)
  4308.  
  4309.  
  4310. 1.16. UNIX Specifics
  4311.  
  4312.  
  4313. 1.16.1. The UNIX File System
  4314.  
  4315. Consult your UNIX manual for details about the file system under your version
  4316. of UNIX.  In general, UNIX files have lowercase names, possibly containing one
  4317. or more dots or other special characters.  UNIX directories are tree-
  4318. structured.  Directory levels are separated by slash ("/") characters.  For
  4319. example,
  4320.  
  4321.     /usr/foo/bar
  4322.  
  4323. denotes the file bar in the directory /usr/foo.  Alphabetic case is significant
  4324. in UNIX file and directory names, i.e. "a" is a different file (or directory)
  4325. from "A".  Wildcard or "meta" characters allow groups of files to be specified.
  4326. "*" matches any string; "?" matches any single character.
  4327.  
  4328. When C-Kermit is invoked with file arguments specified on the UNIX command
  4329. line, the UNIX shell (Bourne Shell, C-Shell, K-Shell, etc) expands the meta
  4330. characters itself, and in this case a wider variety is available.  For example,
  4331.  
  4332.     kermit -s ~/ck[uvm]*.{upd,bwr}]
  4333.  
  4334. is expanded by the Berkeley C-Shell into a list of all the files in the user's
  4335. home directory (~/) that start with the characters "ck", followed by a single
  4336. character "u", "v", or "m", followed by zero or more characters, followed by a
  4337. dot, followed by one of the strings "upd" or "bwr".  Internally, the C-Kermit
  4338. program itself expands only the "*" and "?" meta characters.
  4339.  
  4340. UNIX files are linear (sequential) streams of 8-bit bytes.  Text files consist
  4341. of 7-bit ASCII or ISO-646 NRC characters, with the high-order bit off (0), or
  4342. in very recent versions of UNIX, of 8-bit characters in an ASCII-based
  4343. international standard character set such as ISO 8859 Latin Alphabet 1.  Text
  4344. file lines are separated by the UNIX newline character, which is linefeed (LF,
  4345. ASCII 10).  This distinguishes UNIX text files from those on most other
  4346. ASCII-based stream file systems, in which lines are separated by a carriage-
  4347. return linefeed sequence (CRLF, ASCII 13, followed by linefeed, ASCII 10).
  4348. Binary files are likely to contain data in the high bits of the file bytes, and
  4349. have no particular line or record structure.
  4350.  
  4351.  
  4352. 1.16.2. UUCP Lock Files
  4353.  
  4354. UNIX has no built-in way of obtaining exclusive access to an external
  4355. communication line.  When you issue the 'set line' command to UNIX Kermit, UNIX
  4356. would normally grant you access to the line even if some other process is
  4357. making use of it.  The method adopted by most UNIX systems to handle this
  4358. situation is the "UUCP lock file".  UUCP, the UNIX-to-UNIX Copy program,
  4359. creates a file in its directory (usually /usr/spool/uucp, but often elsewhere)
  4360. with a name like LCK..name, where name is the device name, for instance
  4361. LCK..tty07.
  4362.  
  4363. UNIX Kermit uses UUCP lock files in order to avoid conflicts with UUCP, tip, or
  4364. other programs that follow this convention, including other users running
  4365. Kermit itself.  Whenever you attempt to access an external line using the 'set
  4366. line' command or `-l' on the command line, Kermit looks in the UUCP directory
  4367. for a lock file corresponding to that device.  For instance, if you 'set line
  4368. /dev/ttyi6' then Kermit looks for the file
  4369.  
  4370.     /usr/spool/uucp/LCK..ttyi6
  4371.  
  4372. If it finds this file, it gives you an error message and a directory listing of
  4373. the file so that you can see who is using it, e.g.
  4374.  
  4375.     -r--r--r--  1 fdc    8 Feb  7 13:02 /usr/spool/uucp/LCK..ttyi6
  4376.  
  4377. In this case, you would look up user fdc to find out how soon the line will
  4378. become free.
  4379.  
  4380. This convention requires that the uucp directory be publicly readable and
  4381. writable.  If it is not, the program will issue an appropriate warning message.
  4382.  
  4383. If no lock file is found, UNIX Kermit will attempt create one, thus preventing
  4384. anyone who subsequently tries to run Kermit, UUCP, cu, tip, or similar programs
  4385. on the same line from gaining access until you release the line.  If Kermit
  4386. could not create the lock file (for instance because the uucp directory is
  4387. write-protected), then you will receive an error message.
  4388.  
  4389. Even when the lock directory is writable and readable, the locking mechanism
  4390. depends upon all users using the same name for the same device.  If a device
  4391. has more than one path associated with it, then a lock can be circumvented by
  4392. using an alias.
  4393.  
  4394. When a lock-creating program abruptly terminates, e.g. because it crashes or is
  4395. killed via shell command, the lock file remains in the uucp directory,
  4396. spuriously indicating that the line is in use.  If the lock file is owned by
  4397. yourself, you may remove it.  Otherwise, you'll have to get the owner or the
  4398. system manager to remove it, or else wait for a system task to do so; uucp
  4399. supports a function (uuclean) which removes these files after a predetermined
  4400. age -- uucp sites tend to run this function periodically via crontab.
  4401.  
  4402. Locking is not needed, or used, if communications occur over the user's login
  4403. terminal line (normally /dev/tty).
  4404.  
  4405.  
  4406. 1.16.3. C-Kermit under Berkeley or System III/V UNIX
  4407.  
  4408. C-Kermit may be interrupted at command level or during file transfer by typing
  4409. Control-C.  The program will perform its normal exit function, restoring the
  4410. terminal and releasing any lock.  If a protocol transaction was in progress, an
  4411. error packet will be sent to the opposite Kermit so that it can terminate
  4412. cleanly.
  4413.  
  4414. C-Kermit may be invoked in the background ("&" on shell commmand line).  If a
  4415. background process is "killed", the user will have to manually remove any lock
  4416. file and may need to restore the modem.  This is because the kill signal
  4417. (kill(x,9)) cannot be trapped by Kermit.
  4418.  
  4419. During execution of a system command ('directory', 'cd', or `!'), C-Kermit can
  4420. often be returned to command level by typing a single Control-C.  (With System
  4421. III/V, the usual interrupt function (often the DEL key) is replaced by
  4422. Control-C.)
  4423.  
  4424. Under Berkeley UNIX only: C-Kermit may also be interrupted by ^Z to put the
  4425. process in the background.
  4426.  
  4427. Control-C, Control-Z, and Control-\ lose their normal functions during terminal
  4428. connection and also during file transfer when the controlling tty line is being
  4429. used for packet i/o.
  4430.  
  4431. If you are running C-Kermit in "quiet mode" in the foreground, then
  4432. interrupting the program with a console interrupt like Control-C will not
  4433. restore the terminal to normal conversational operation.  This is because the
  4434. system call to enable console interrupt traps will cause the program to block
  4435. if it's running in the background, and the primary reason for quiet mode is to
  4436. allow the program to run in the background without blocking, so that you can do
  4437. other work in the foreground.
  4438.  
  4439. If C-Kermit is run in the background ("&" on shell commmand line), then the
  4440. interrupt signal (Control-C) (and System III/V quit signal) are ignored.  This
  4441. prevents an interrupt signal intended for a foreground job (say a compilation)
  4442. from being trapped by a background Kermit session.
  4443.  
  4444.  
  4445. 1.16.4. C-Kermit on the AT&T UNIX PC
  4446.  
  4447. For UNIX PC owners here are a couple of hints.  The name of the phone line
  4448. devices are /dev/ph0 and /dev/ph1. The RS232 serial port is /dev/tty000.
  4449.  
  4450. Dialing out with the internal modem:
  4451.  
  4452.     C-Kermit>set line /dev/ph0
  4453.     C-Kermit>set speed 1200
  4454.     C-Kermit>set modem att7300
  4455.     C-Kermit>dial (123) 555-1212
  4456.  
  4457. Or use /dev/ph1 for the second phone line.  Control-C will terminate the
  4458. dialer.  The telephone line must be in the DATA state; C-Kermit will remind you
  4459. of this if it finds the line in VOICE state.
  4460.  
  4461. Connecting via the RS232C serial port:
  4462.  
  4463.     $ kermit
  4464.     C-Kermit>set line /dev/tty000
  4465.     C-Kermit>set speed 9600
  4466.         (start doing work...)
  4467.         (after exiting C-Kermit you may type:)
  4468.  
  4469. C-Kermit automatically handles disabling and enabling logins on the phone lines
  4470. and RS-232 port.
  4471. 1.17. X.25 Support
  4472.  
  4473. This section applies only to UNIX C-Kermit on SUN computers that are attached
  4474. to X.25 networks via the SunLink X.25 product.
  4475.  
  4476. To use an X.25 connection:
  4477.  
  4478.     C-Kermit>set network x.25
  4479.     C-Kermit>set host aaaaaaa
  4480.     C-Kermit>connect
  4481.  
  4482. where aaaaaaa is the X.121 address of the host you wish to connect to.  An
  4483. X.121 address is a many-digit number consisting of a 4-digit DNIC (Data Network
  4484. Identification Code) followed by an NTN (Network Terminal Number) up to 10
  4485. digits in length, or a 3-digit DCC (Data Country Code) followed by a
  4486. country-dependent NN (National Number) up to 11 digits in length.
  4487.  
  4488. The following connect-mode escapes apply to X.25 terminal connections:
  4489.  
  4490. Ctrl-\H
  4491.     Hangup - Close the X.25 network connection.
  4492.  
  4493.  
  4494. Ctrl-\I
  4495.     Interrupt - Send an X.25 interrupt packet.
  4496.  
  4497.  
  4498. Ctrl-\R
  4499.     Reset the X.25 virtual circuit.
  4500.  
  4501. The following special commands can be used to control your X.25 connection:
  4502.  
  4503. HANGUP
  4504.     Close the X.25 network connection.
  4505.  
  4506.  
  4507. PAD CLEAR
  4508.     Clear the X.25 virtual circuit.
  4509.  
  4510.  
  4511. PAD INTERRUPT
  4512.     Send an X.25 Interrupt packet.
  4513.  
  4514.  
  4515. PAD RESET
  4516.     Reset the X.25 virtual circuit.
  4517.  
  4518.  
  4519. PAD STATUS
  4520.     X.25 status request.
  4521.  
  4522.  
  4523. SET PAD BREAK-ACTION n
  4524.     X.3 Parameter 7.  What PAD should do if it receives a BREAK signal.  0 =
  4525.     nothing, 1 = send Interrupt packet, 2 = reset, 4 = send Indication Of Break
  4526.     PAD message, 8 = escape to PAD, 16 = discard output.  Default = 21 (= 16 +
  4527.     4 + 1).
  4528.  
  4529.  
  4530. SET PAD BREAK-CHARACTER n
  4531.     Default 0.
  4532.  
  4533.  
  4534. SET PAD LINE-DELETE n
  4535.     X.3 Parameter 17.  0-127 = ASCII value of character to be used for erasing
  4536.     a line.  Default = 21 (Ctrl-U).
  4537.  
  4538.  
  4539. SET PAD CHARACTER-DELETE n
  4540.     X.3 Parameter 16.  0-127 = ASCII value of character to be used for erasing
  4541.     a character.  Default = 8 (Ctrl-H = Backspace).
  4542.  
  4543.  
  4544. SET PAD CR-PADDING n
  4545.     X.3 Parameter 9, Padding After Carriage Return (CR).  0-255.  Number of
  4546.     padding characters PAD should send to DTE after sending a CR.  Default = 0.
  4547.  
  4548.  
  4549. SET PAD DISCARD-OUTPUT { 0, 1 }
  4550.     X.3 Parameter 8.  0 = normal data delivery, 1 = discard output.  Default =
  4551.     0.
  4552.  
  4553.  
  4554. SET PAD LINE-DISPLAY n
  4555.     X.3 Parameter 18.  0-127 = ASCII value of character to redisplay an edited
  4556.     line.  Default = 18 (Ctrl-R).
  4557.  
  4558.  
  4559. SET PAD ECHO { 0, 1 }
  4560.     X.3 Parameter 2.  0 = PAD will not echo, 1 = PAD will echo.  Default = 1.
  4561.  
  4562.  
  4563. SET PAD EDITING { 0, 1 }
  4564.     X.3 Parameter 15.  0 = No editing, 1 = editing allowed.  Default = 1.
  4565.  
  4566.  
  4567. SET PAD ESCAPE { 0, 1 }
  4568.     X.3 Parameter 1.  0 = Escape to PAD not possible, 1 = Ctrl-P escapes to
  4569.     PAD.
  4570.  
  4571.  
  4572. SET PAD FORWARD n
  4573.     X.3 Parameter 3, Data Forwarding Characters.  0 = none, 1 = any
  4574.     alphanumeric, 2 = carriage return, etc.  Default = 2.
  4575.  
  4576.  
  4577. SET PAD LF-PADDING n
  4578.     X.3 Parameter 14. 0-255 padding characters to be sent by PAD after
  4579.     linefeed.  Default = 0.
  4580.  
  4581.  
  4582. SET PAD LF-INSERT n
  4583.     X.3 Parameter 13, Linefeed (LF) insertion after carriage return (CR).  0 =
  4584.     no LF insertion, 1 = PAD inserts LF after each CR sent to DTE, 2 = PAD
  4585.     inserts LF after each CR received from DTE, 4 = PAD echoes LF as CRLF.
  4586.     Default = 0.
  4587.  
  4588.  
  4589. SET PAD LINE-FOLD n
  4590.     X.3 Parameter 10, Line Folding.  0 = none, 1-255 = number of graphic
  4591.     characters per line after which to insert folding characters.  Default = 0.
  4592.  
  4593.  
  4594. SET PAD PAD-FLOW-CONTROL { 0, 1 }
  4595.     X.3 Parameter 5.  0 = No flow control by PAD, 1 = PAD may send Xon/Xoff
  4596.     flow control to user.  Default = 0.
  4597.  
  4598.  
  4599. SET PAD SERVICE-SIGNALS { 0, 1 }
  4600.     X.3 parameter 6, PAD Service and Command Signals.  0 = PAD service signals
  4601.     are not sent to DTE, 1 = PAD service signals sent.  Default = 1.
  4602.  
  4603.  
  4604. SET PAD TIMEOUT n
  4605.     X.3 Parameter 4, Data forwarding timeout, 0-255 (twentieths of a second).
  4606.     Default = 0 (no data forwarding on timeout).
  4607.  
  4608.  
  4609.  
  4610.  
  4611. SET PAD USER-FLOW-CONTROL { 0, 1 }
  4612.     X.3 Parameter 12.  0 = no flow control by user, 1 = user device may send
  4613.     Xon/Xoff flow control to PAD.  Default = 0.
  4614.  
  4615.  
  4616. SET X.25 CALL-USER-DATA { ON [ text ], OFF }
  4617.     OFF = no call user data, ON text sends the given text during call setup.
  4618.  
  4619.  
  4620. SET X.25 CLOSED-USER-GROUP { OFF, ON n }
  4621.     OFF = no closed user group, ON n specifies the user group number, 0 to 99.
  4622.     OFF by default.
  4623.  
  4624.  
  4625. SET X.25 REVERSE-CHARGE { OFF, ON }
  4626.     OFF = caller pays, ON = callee pays.  Default is OFF.
  4627.  
  4628.  
  4629. 1.18. C-Kermit under VAX/VMS
  4630.  
  4631. This section contributed by Terry Kennedy, St. Peter's College, Jersey City,
  4632. NJ, USA.
  4633.  
  4634.  
  4635. 1.18.1. File Transfer Issues
  4636.  
  4637. VMS provides a plethora of file formats, most of which have no direct
  4638. equivalent on other operating systems (especially the other operating systems
  4639. that C-Kermit runs under).  Thus, the user is faced with the issue of file
  4640. format conversion.  VMS C-Kermit attempts to make this as painless as possible
  4641. by mapping the various file formats to canonical form on transmission, and by
  4642. creating the simplest file structure upon reception.  Various C-Kermit commands
  4643. may be used to give C-Kermit "hints" about what the user desires.  Some of
  4644. these work only when sending files, others only when receiving files.  First,
  4645. let's discuss some terms:
  4646.  
  4647. BINARY TRANSFER MODE (SET FILE TYPE BINARY)
  4648.  
  4649. When sending a file, C-Kermit/VMS reads bytes from the file and sends them
  4650. without any kind of interpretation, translation, or reformatting.  In
  4651. particular, no characters are inserted at record boundaries.
  4652.  
  4653. When receiving files, C-Kermit/VMS collects bytes and writes them to disk at
  4654. intervals.  The file is created as "Fixed" organization, with the record size
  4655. specifed by the user with SET FILE RECORD-LENGTH, or the default value of 512
  4656. if the user does not override it.  For both send and receive operations, the
  4657. RMS attribute "First free byte" is used.  Thus, VMS C-Kermit can operate on
  4658. files where the file size (in bytes) is not an exact multiple of the file
  4659. record size.
  4660.  
  4661. TEXT TRANSFER MODE (SET FILE TYPE TEXT)
  4662.  
  4663. When sending files, C-Kermit/VMS attempts to convert the file to a form which
  4664. has the proper delimiters for "canonical Kermit protocol" form.  Specifically,
  4665. CR and LF characters are inserted as needed at the end of each record.  This is
  4666. normally an easy task, but is complicated by some VMS file types (such as the
  4667. "Fortran carriage control" type).  On reception, files are created as
  4668. "Sequential variable, carriage return carriage control".  C-Kermit uses a CR
  4669. followed immediately by a LF as a record delimiter.  Lone CR's or LF's are
  4670. written as part of a record if they are present.
  4671.  
  4672. LABELED TRANSFER MODE (SET FILE TYPE LABELED)
  4673.  
  4674. When in this mode, C-Kermit/VMS gathers information about the file from various
  4675. sources, such as the file's directory entry, ACL's, etc. and transmits it as
  4676. part of the file data. This is called a LABELED FILE. Such files are not usable
  4677. on non-VMS systems, but may be stored on such systems and later restored to
  4678. another (or the same) VAX. An external utility named CKVCVT reconstitutes the
  4679. file as it was, with various options.
  4680.  
  4681. Other systems should treat labeled files as simple files of TYPE BINARY.
  4682.  
  4683. Now, let's discuss the actions of sending or receiving:
  4684.  
  4685.  
  4686. 1.18.1.1. Sending Files from VMS C-Kermit
  4687.  
  4688. The requested file is opened and the VMS file characteristics are examined.
  4689. Files of format "Undefined" or "Fixed" are sent as binary files, other formats
  4690. are sent as text files.
  4691.  
  4692. SET FILE TYPE IMAGE.  This forces the file to be sent as a stream of bytes,
  4693. regardless of file characteristics, with a file type of binary declared in the
  4694. attribute packet.  This is useful for cases where other applications generate
  4695. file contents with inappropriate file characteristics (for example, a stream-LF
  4696. file which is actually binary data).  This should only be used as a last
  4697. resort, as [normally] RMS inserts bytes in the file for control purposes, and
  4698. these bytes are transmitted (and misinterpreted by the receiving system).
  4699.  
  4700. SET FILE TYPE LABELED forces the file to be sent in labeled format, with
  4701. C-Kermit reading the file from the disk as in IMAGE mode, and with a file type
  4702. of binary declared in the attribute packet.
  4703.  
  4704.  
  4705. 1.18.1.2. Receiving Files to VMS C-Kermit
  4706.  
  4707. The characteristics supplied in the file's attribute packet are used to
  4708. determine the desired file type.  If no attribute packet arrives, the current
  4709. SET FILE TYPE setting, TEXT or BINARY, is used.  If the current file type is
  4710. IMAGE, BINARY is used.  SET FILE TYPE UNDEFINED forces the received file to be
  4711. written with RMS RECORD FORMAT UNDEFINED for compatbility with some software
  4712. that uses non-RMS routines for manipulating files.  This option should normally
  4713. not be used, as you will generate files VMS can't do anything with.
  4714.  
  4715. If the current FILE TYPE is LABELED, the incoming file is handled in LABELED
  4716. mode if (a) its attribute packet declares its type to be binary, OR (b) there
  4717. is no attribute packet.  If the attribute packet says the file type is text,
  4718. C-Kermit rejects the file. At the present time, C-Kermit does not understand
  4719. received labeled files, and you should use the external CKVCVT utility to
  4720. convert them.
  4721.  
  4722.  
  4723. 1.18.2. PRACTICAL APPLICATIONS
  4724.  
  4725.  
  4726. 1.18.2.1. Between a VMS System and a Different System
  4727.  
  4728. The defaults should function properly, provided that the receiving system uses
  4729. the "stream-of-bytes" philosophy of UNIX.  Extensive testing has been done
  4730. between VMS C-Kermit and UNIX C-Kermit, as well as MS-DOS Kermit.  Other
  4731. systems may require a re-thinking of the transfer strategy, but this author
  4732. [tmk] considers it unlikely.
  4733.  
  4734.  
  4735. 1.18.2.2. Between VMS Systems
  4736.  
  4737. The goal of the defaults is to produce useful output in the majority of cases.
  4738. If you need to transfer binary files where record boundaries are important and
  4739. don't occur at fixed intervals (such as .OBJ files), or where the file
  4740. semantics are extensive and not propagated by C-Kermit (such as DDIF files,
  4741. indexed files, or files with extended semantics stored in an ACE, such as PCSA
  4742. file service contents), you have two options.
  4743.  
  4744.    1. SET FILE TYPE LABELED.  Give this command to the sending C-Kermit
  4745.       system, receive the file on the target VMS system, and extract the
  4746.       contents with CKVCVT.
  4747.  
  4748.    2. Encapsulate these files using VMS BACKUP, transfer the BACKUP
  4749.       saveset, and then restore it on the target system.  BACKUP produces
  4750.       output files with a simple fixed length record structure.  You
  4751.       should specify an explicit record size on the BACKUP command line
  4752.       such as:
  4753.  
  4754.           BACKUP *.* FILES.BCK/SAVE_SET/RECORD=8192
  4755.  
  4756.       and give the record size to the receiving Kermit with the command
  4757.       SET FILE RECORD-LENGTH before sending your saveset.
  4758.  
  4759.  
  4760. 1.18.3. Compatibility with Bliss-32 Kermit
  4761.  
  4762. Testing has shown that the two Kermits make similar assumptions about file
  4763. characteristics.  A variety of files were uploaded from MS-DOS to VMS with
  4764. Bliss-32 Kermit, using a variety of transfer modes, and then returned to MS-DOS
  4765. with C-Kermit and a byte-for-byte comparison was performed.  The reverse
  4766. operation was then tried and tested.  No discrepancies were found.  Although
  4767. this does not guarantee 100% compatibility, it is very close.  Equivalences:
  4768.  
  4769. C-Kermit/VMS                  Bliss Kermit-32
  4770.  
  4771. SET FILE TYPE TEXT            SET FILE TYPE ASCII
  4772. SET FILE TYPE BINARY [FIXED]  SET FILE TYPE BINARY, SET FILE TYPE FIXED
  4773. SET FILE TYPE BIN UNDEF       (none)
  4774. SET FILE TYPE IMAGE           SET FILE TYPE BLOCK
  4775. SET FILE TYPE LABELED         (none)
  4776.  
  4777. Note: There is no distinction between SET FILE TYPE BINARY and FIXED in
  4778. C-Kermit/VMS, and none is needed.  C-Kermit determines the file type and length
  4779. automatically when sending, and when receiving binary files, creates a
  4780. fixed-format file and marks the true end using the "first free byte" mechanism
  4781. of RMS.  EXCEPT if you have given the command SET FILE TYPE BINARY UNDEFINED,
  4782. in which case the file is stored with the RMS record format of UNDEFINED rather
  4783. than fixed (but in the same format as a fixed file).
  4784.  
  4785.  
  4786. 1.18.4. Date and Time Attributes
  4787.  
  4788. The VMS C-Kermit server sends the file's creation date in the attribute packet
  4789. when a file is sent.  When receiving files, if there was valid date/time
  4790. information in the attribute packet, C-Kermit will set the new file's creation
  4791. date/time to the value provided.  The file will be marked as being revised once
  4792. (initial creation), on the current date/time.  This is necessary to ensure that
  4793. the file will be detected as "new" by VMS BACKUP.  You should also note that if
  4794. a file with a creation date in the future (as perceived by VMS) is received
  4795. from a remote Kermit, the system will report "File has creation date in the
  4796. future" to your system management if they use the ANALYZE/DISK command before
  4797. the file's creation date has occured.
  4798.  
  4799. VMS C-Kermit has the command SET FILE COLLISION UPDATE, which can be used to
  4800. reject files when there is a newer file than the incoming one with the same
  4801. name.  If you use this option, be aware that due to system clock skew, you may
  4802. be able to send the file several times in succession before VMS C-kermit
  4803. rejects it as [now] being older than the one on the VAX.
  4804.  
  4805.  
  4806. 1.18.5. File Size Attributes
  4807.  
  4808. When sending files, VMS C-Kermit fills in the file size information in the
  4809. attribute packet. Note that the reported sizes may differ from the actual size
  4810. due to insertion of CR/LF characters on transmission.
  4811.  
  4812. For received files, VMS C-Kermit checks checks for sufficient free disk space
  4813. if the remote Kermit supplies file size information. If there isn't enough
  4814. space on the disk, VMS C-Kermit will reject the file. Please note that user
  4815. quotas are not checked. The logic to do so is quite complicated, and would lead
  4816. to VMS C-Kermit rejecting files that could be received. As an example, consider
  4817. a user with EXQUOTA privilege. In general, a file size rejection by VMS
  4818. C-Kermit means the file will not fit; the lack of a rejection does not
  4819. guarantee that the file will fit. Consider a small file being received onto an
  4820. RX50 floppy. If debugging is turned on, the debug output will fill the floppy
  4821. before the file is completely received.
  4822.  
  4823. If the device for the received file is not a disk (for example, the system
  4824. lineprinter) the file is assumed to always fit.
  4825.  
  4826.  
  4827. 1.18.6. SET FILE TYPE LABELED
  4828.  
  4829. Labeled files contain various pieces of information needed to reconstruct the
  4830. file. At the moment, this is handled by an external utility known as CKVCVT.
  4831. Some items are always restored and other are not restored unless the user
  4832. explicitly asks for them. File characteristics are always restored.  The file
  4833. name is restored (de-truncated). However, the complete directory specification
  4834. is not used to recreate the file unless explicitly requested.  This means that
  4835. converted files will normally be restored to your current directory. Similarly,
  4836. file ownership is assigned to you unless you specify that the original owner be
  4837. retained. Note that the two previous options will require privileges. The file
  4838. backup date is normally cleared so that the file will be backed up. This action
  4839. may be overridden.
  4840.  
  4841. File ACE's are normally not restored. This is an all-or-nothing operation, as
  4842. there are many types of ACE's under VMS. The most common usage of an ACE is to
  4843. grant/deny file access to other users. However, various other uses exist. Some
  4844. examples are: RMS Journaling, RMS Statistics, DDIF, and Pathworks.  Note that
  4845. ACE's are transported in binary mode, which means that protection ACE's may
  4846. wind up applying to incorrect users if you move files between different VMS
  4847. systems with ACE's enabled. Also, note that you can create ACE's which you
  4848. cannot see with DIR/FULL unless you have SECURITY privilege.  However, you
  4849. should be able to view (but not modify) them with EDIT/ACL. This also means
  4850. that you will not be able to delete these ACE's without deleting the file,
  4851. which is another reason they are normally not restored.
  4852.  
  4853. RMS Journaling files are a special case. Journaling will not be enabled for a
  4854. received labeled file. A DIR/FULL will show the journaling ACE, which you can
  4855. use to determine the correct journaling paramters if you wish to journal the
  4856. new file. Note that if you restore the file to another disk (even if it is on
  4857. the same system) the journaling information will display incorrectly.  This is
  4858. a limit of the DEC RMS Journaling product.
  4859.  
  4860.  
  4861. 1.18.7. Reporting Problems
  4862.  
  4863. If you have a file that does not transfer correctly, or that exhibits a problem
  4864. when moved one way with Bliss-32 Kermit and the back with C-Kermit, we would be
  4865. interested in seeing it (especially if it's small 8-).  Please make a BACKUP
  4866. saveset of it under VMS, and send the saveset along to the BUGS address (use
  4867. the command BUG in C-Kermit for up-to-date information).  Please include any
  4868. specific information you think would be useful.  As a bare minimum, please give
  4869. the Kermit version number(s), the VMS version, and the compiler version (if you
  4870. re-compiled Kermit).
  4871. 1.18.8. Sections that need to be added
  4872.  
  4873. Hints for users and system managers on configuring their VMS system and
  4874. terminal devices for best use with Kermit -- BYTLM quotas, Alt-typahead
  4875. buffers, etc etc.  What are the sysgen options, what SET TERMINAL commands (if
  4876. any) should be used before running C-Kermit, etc...
  4877.  
  4878.  
  4879. 1.19. C-Kermit under OS/2
  4880.  
  4881. This section describes special considerations for using C-Kermit under OS/2.
  4882.  
  4883. C-Kermit 4E(72) was adapted to OS/2 by Chris Adie of Edinburgh University,
  4884. Scotland, UK.  The OS/2-specific code was adapted to version 5A(179) and parts
  4885. of it were rewritten by Kai Uwe Rommel of the Technical University of Munich,
  4886. Germany.
  4887.  
  4888. C-Kermit is a protected-mode program.  It will not run in the DOS compatability
  4889. environment.  This means that it will continue running (eg transferring files)
  4890. even when it is not the foreground session.
  4891.  
  4892. The OS/2 C-Kermit initialization file is called CKERMIT.INI.
  4893.  
  4894. All numbers in the C-Kermit documentation are decimal unless noted otherwise.
  4895.  
  4896.  
  4897. 1.19.1. Requirements
  4898.  
  4899. C-Kermit will run on a computer with an 80286 or 80386 processor running OS/2
  4900. version 1.0 or higher.  It runs in character mode - in other words it is not a
  4901. Presentation Manager application.  However, it will run in a Presentation
  4902. Manager window as a character application.  Normally, though, you would run it
  4903. from the command processor (CMD.EXE) prompt.
  4904.  
  4905.  
  4906. 1.19.2. The Serial Port
  4907.  
  4908. Naturally, a serial port (COM1 through COM4) is required. The OS/2 serial port
  4909. device driver must be loaded using a line like one of the following in the
  4910. CONFIG.SYS file:
  4911.  
  4912.                         DEVICE=COM01.SYS
  4913.     or                  DEVICE=COM02.SYS
  4914.     or                  DEVICE=COM.SYS
  4915.  
  4916. COM01.SYS is used for PC/AT - type machines, while for PS/2s COM02.SYS must be
  4917. used. C-Kermit will not work if this device driver is not loaded. (It provides
  4918. the Category 1 IOCTLs which are used extensively within the program.) COM01.SYS
  4919. and COM02.SYS are used for version 1.x of OS/2 only. For the version 2.0 of
  4920. OS/2 (soon to be released), only one driver COM.SYS exists for both types of
  4921. machines.
  4922.  
  4923. The connecting cable and the modem (or other computer, PAD etc to which your
  4924. computer is connected) must satisfy the requirements of your computer's RS232
  4925. interface.  In particular, the computer will provide two output control signals
  4926. (RTS and DTR), and may expect to see signals on four input lines (DCD, DSR,
  4927. CTS, RI).  The precise behaviour of these lines is software configurable (for
  4928. instance by using the OS/2 'MODE' command), and C-Kermit makes no attempt to
  4929. impose a particular method of using them.
  4930.  
  4931. By default, the DTR and RTS line will both go ON when C-Kermit opens the comms
  4932. port, and they will go OFF when it is closed.
  4933.  
  4934. The default behaviour for the input lines is that DSR and CTS must be ON to
  4935. enable the port to work.  If the modem you are connected to does not provide
  4936. these signals, you can 'loop back' the RTS output signal from the computer to
  4937. DSR and CTS, using a suitably modified cable.  An alternative is to use the
  4938. MODE command to disable the DSR and CTS inputs.  To do this, type a command
  4939. similar to the following at the OS/2 CMD prompt:
  4940.  
  4941.     MODE COM1:9600,N,8,1,OCTS=OFF,ODSR=OFF,IDSR=OFF
  4942.  
  4943. You can check the effect using:
  4944.  
  4945.     MODE COM1
  4946.  
  4947. which reports the current settings of COM1.  Note that on some machines,
  4948. C-Kermit may appear to work even although DSR and CTS are not connected to
  4949. anything, nor disabled using 'MODE'.  This is because unconnected input lines
  4950. tend to 'float high'.  Although this situation may not cause any problems, it
  4951. is not good practice - you should explicitly disable the inputs as above.
  4952.  
  4953. The 'MODE' utility also allows you to change the baud rate, parity, number of
  4954. data bits and number of stop bits.  C-Kermit provides facilities for changing
  4955. the baud rate and parity too (see later in this manual), but when it starts up,
  4956. it resets the parity to none and the number of data bits to 8.  Any changes to
  4957. baud rate and parity will remain in effect after C-Kermit terminates.
  4958.  
  4959. If you change the parity within C-Kermit, it will ajust the number of data bits
  4960. to cope.  There is no way of changing the number of stop bits within C-Kermit:
  4961. use 'MODE' to do this.
  4962.  
  4963. There is also no way to change the hardware flow control settings from within
  4964. C-Kermit. There are too many possible settings for the OS/2 serial driver to
  4965. duplicate all 'MODE' options into C-Kermit. You can use 'MODE' to adjust the
  4966. hardware flow control and the settings are used by C-Kermit without
  4967. modification. You can, however, change the software flow control from within
  4968. C-Kermit.
  4969.  
  4970.  
  4971. 1.19.3. Emergency Exit
  4972.  
  4973. EMERGENCY EXIT:  The Control-C and Control-Break keys cannot be used to
  4974. terminate C-Kermit.  To terminate C-Kermit unconditionally, you can select it
  4975. in the task list and choose 'Terminate' (OS/2 1.x) or select it in the window
  4976. list and choose the 'Close' option from the menu (OS/2 2.0).
  4977.  
  4978. C-Kermit returns an exit status of zero, except when a fatal error is
  4979. encountered, when the exit status is set to one.  This can be used in a batch
  4980. file, to take some action depending on whether the operation was successful.
  4981. For instance, suppose the file SEND.CMD contains the following:
  4982.  
  4983.     echo Sending %1 out port %2
  4984.     kermit -ql COM%2 -b 9600 -s %1
  4985.     if ERRORLEVEL 1 goto badend
  4986.     echo Transferred succcessfully!
  4987.     goto end
  4988.     :badend
  4989.     echo Transfer problems!
  4990.     :end
  4991.  
  4992. To send a file FOO.BAS, you could type:
  4993.  
  4994.  
  4995.     send foo.bas 2
  4996.  
  4997. to send it to another computer running Kermit, connected to port COM2.  If the
  4998. transfer completed OK, you would get the message 'Transferred successfully!'.
  4999.  
  5000.  
  5001. 1.19.4. The OS/2 File System
  5002.  
  5003. The features of the OS/2 file system of greatest interest to Kermit users are
  5004. the form of the file specifications, and the formats of the files themselves.
  5005. Note that the following discussion refers to the MS-DOS compatible file system
  5006. supported by initial versions of OS/2.  Installable file systems are not
  5007. covered here - they are significantly different, and the extent to which
  5008. C-Kermit will work under such file systems is unknown (because no installable
  5009. file system has been released at the time of writing).
  5010.  
  5011.  
  5012. 1.19.4.1. File Specifications
  5013.  
  5014. OS/2 file specifications are of the form
  5015.  
  5016.  
  5017.     DEVICE:\PATHNAME\NAME.TYPE
  5018.  
  5019. where DEVICE stands for a single character identifier (for instance, A for the
  5020. first floppy disk, C for the first fixed disk, D for a RAM disk emulator)
  5021. followed by a colon (':'), PATHNAME is up to 63 characters of identifier(s) (up
  5022. to 8 characters each) surrounded by backslashes ('\'), NAME is an identifier of
  5023. up to 8 characters, and TYPE is an identifier of up to 3 characters in length.
  5024. Device and pathname may be omitted.  The first backslash in the pathname may be
  5025. omitted if the specified path is relative to the current directory.  In the
  5026. path field, '.' means the current directory, '..' means the parent directory.
  5027.  
  5028. Note that the name, type and path length restrictions apply to the original FAT
  5029. file system of OS/2. The HPFS file system added in later revisions does not
  5030. have such hard restrictions. However, C-Kermit will not take much advantage of
  5031. the long HPFS file names except that it recognizes them when sending/receiving
  5032. files.
  5033.  
  5034. The device and directory specification is normally omitted, but can be
  5035. specified in all C-Kermit commands.  Device and directory pathnames, when
  5036. omitted, default to either the user's current disk and directory, or to the
  5037. current directory search path as specified in the PATH environment variable,
  5038. depending on the context in which the file name appears.
  5039.  
  5040. The C-Kermit command line parser treats backslash characters specially and thus
  5041. requires you either to enter two backslashs when you want to enter one in a
  5042. file specification or to enter a forward slash instead.  The following two
  5043. commands are equivalent.
  5044.  
  5045.     C-Kermit>send c:\\autoexec.bat
  5046.     C-Kermit>send c:/autoexec.bat
  5047.  
  5048. NAME.TYPE is sufficient to specify a file on the current disk and directory,
  5049. and only this information is sent along by C-Kermit with an outgoing file (by
  5050. default).
  5051.  
  5052. The device, path, name, and type fields may contain uppercase letters, digits,
  5053. and the special characters '-' (dash), '_' (underscore), '$' (dollar sign), '&'
  5054. (ampersand), '#' (number sign), '@' (at sign), '!' (exclamation mark), '''
  5055. (single quote), '()' (parentheses), '{}' (curly braces), '^' (caret or
  5056. circumflex), '~' (tilde), and '`' (accent grave).  Normally, you should confine
  5057. your filenames to letters and digits for maximum transportability to non-OS/2
  5058. systems (by default, C-Kermit will translate filenames being sent by converting
  5059. non-alphanumeric characters to 'X').  When you type lowercase letters in
  5060. filenames, they are converted automatically to uppercase.  There are no
  5061. imbedded or trailing spaces.  Other characters may not be included; there is no
  5062. mechanism for "quoting" otherwise illegal characters in filenames.  The fields
  5063. of the file specification are set off from one another by the punctuation
  5064. indicated above (ie colon, backslash and dot).
  5065.  
  5066. The name field is the primary identifier for the file.  The type, also called
  5067. the extension or suffix, is an indicator which, by convention, tells what kind
  5068. of file we have.  For instance FOO.BAS is the source of a BASIC program named
  5069. FOO; FOO.OBJ might be the relocatable object module produced by compiling
  5070. FOO.BAS; FOO.EXE could be an executable program produced by loading FOO.OBJ,
  5071. and so forth.  .EXE is the normal suffix for executable programs.
  5072.  
  5073. OS/2 allows a group of files to be specified in a single file specification by
  5074. including the special "wildcard" characters, '*' and '?'.  A '*' matches any
  5075. string of characters from the current position to the end of the field,
  5076. including no characters at all; a '?' matches any single character.  Here are
  5077. some examples:
  5078.  
  5079. *.BAS           All files of type BAS (BASIC source files) in the current
  5080.                 directory.
  5081.  
  5082. FOO.*           Files of all types with name FOO.
  5083.  
  5084. F*.*            All files whose names start with F.
  5085.  
  5086. *.?             All files with types exactly one character long, or with no
  5087.                 type at all.
  5088.  
  5089. Wildcard notation is used on many computer systems in similar ways, and it is
  5090. the mechanism most commonly used to instruct Kermit to send a group of files.
  5091.  
  5092. You should bear in mind that other (non-OS/2) systems may use different
  5093. wildcard characters.  For instance VMS and the DEC-20 use '%' instead of '?' as
  5094. the single character wildcard; when using C-Kermit to request a wildcard file
  5095. group from a Kermit-20 server, the OS/2 '?' must be replaced by the DEC-20 '%'.
  5096.  
  5097.  
  5098. 1.19.4.2. File Formats
  5099.  
  5100. OS/2 systems store files as streams of 8-bit bytes, with no particular
  5101. distinction among text, program code, and binary files.  ASCII text files
  5102. consist of lines separated by carriage-return-linefeed sequences (CRLFs), and
  5103. this conforms exactly to the way Kermit represents text files during
  5104. transmission.
  5105.  
  5106. OS/2 (unlike CP/M) knows the exact end of a file because it keeps a byte count
  5107. in the directory, so one would expect no particular confusion in this regard.
  5108. However, certain MS-DOS and OS/2 programs continue to use the CP/M convention
  5109. of terminating a text file with a Control-Z character. This may cause problems
  5110. when the file is transferred elsewhere, since other systems may object to the
  5111. Control-Z. By default, therefore, C-Kermit treats the first Control-Z it finds
  5112. in the file as being equivalent to end-of-file. The Control-Z is not
  5113. transmitted to the other system. Of course, this leads to problems when
  5114. transferring non-text files, when we do want any Control-Zs in the file to be
  5115. sent. To achieve this, the C-Kermit 'set file type binary' command may be used.
  5116. The opposite, 'set file type text', is the default.
  5117.  
  5118.  
  5119. 1.19.5. Terminal Emulation
  5120.  
  5121. The CONNECT-mode escape character is Ctrl-] (Ctrl-Rightbracket) by default, but
  5122. you can change it to any other control character with the SET ESCAPE command.
  5123.  
  5124. In connect mode, C-Kermit emulates a DEC VT102 terminal.  See the section
  5125. "Terminal Emulation" for details of how the emulation works.
  5126.  
  5127. In CONNECT mode, keyboard input is obtained through the KBD subsystem, and
  5128. screen output is through the VIO subsystem. It is therefore impossible to
  5129. redirect terminal I/O.
  5130.  
  5131. When you issue a 'connect' command the first time after starting Kermit, the
  5132. screen clears and the cursor is positioned at the top left-hand corner.  You
  5133. can log into the remote host computer as normal.  In this mode, the PC emulates
  5134. a DEC VT102 terminal, so any control codes or escape sequences received from
  5135. the host will be actioned appropriately.
  5136.  
  5137. The 25th line on the screen is used as a status line, giving the name of the
  5138. communications port, the current transmission speed, and how to obtain help.
  5139.  
  5140. Some keys on the VT102 keyboard have no direct equivalent on the PC keyboard.
  5141. The following table shows the mapping which obtains between VT102 keys and PC
  5142. keys.  Note that the Alt n combinations use the number keys along the top row
  5143. of the keyboard, not the numeric keypad.
  5144.  VT102              IBMPC
  5145.  
  5146. Delete              Del
  5147. PF1                 F1
  5148. PF2                 F2
  5149. PF3                 F3
  5150. PF4                 F4
  5151. Keypad 0            Alt 0
  5152. Keypad 1            Alt 1
  5153. Keypad 2            Alt 2
  5154. Keypad 3            Alt 3
  5155. Keypad 4            Alt 4
  5156. Keypad 5            Alt 5
  5157. Keypad 6            Alt 6
  5158. Keypad 7            Alt 7
  5159. Keypad 8            Alt 8
  5160. Keypad 9            Alt 9
  5161. Keypad minus        F5 or F6
  5162. Keypad comma        F7 or F8
  5163. Keypad dot          F9
  5164. Keypad enter        F10
  5165. No Scroll           Scroll-Lock
  5166.  
  5167. The PC's 'Scroll-Lock' key (equivalent to the VT102 'No Scroll' key) freezes
  5168. the data on the screen. It is typically used when listing a long file, to
  5169. prevent information being scrolled off the top of the screen. Note that the
  5170. Control-S and Control-Q (Xon/Xoff) keys should not be used for this purpose if
  5171. 'flow' is set to 'xon/xoff', because they interfere with the correct operation
  5172. of the comms device driver flow control. When the 'Scroll-Lock' key is pressed,
  5173. an 'xoff' will be sent automatically when the device driver's receive buffer
  5174. fills up, and an 'xon' will be sent as it empties after the 'Scroll-Lock' key
  5175. has been pressed a second time to unfreeze the screen. All other keys are
  5176. ignored when the screen is frozen. The status line indicates when the emulator
  5177. is in this state.
  5178.  
  5179. Information which scrolls off the top of the screen is not in fact lost, but is
  5180. stored in an "extended display buffer", which can be examined by pressing the
  5181. 'PgUp' key. The extended display buffer can contain a number of screenfulls of
  5182. data, and the 'PgUp' and 'PgDn' keys can be used to range freely through this
  5183. data. If any other key is pressed while the extended display buffer is visible,
  5184. the current screen contents are redisplayed and the keystroke is sent to the
  5185. host. The 'PgUp' and 'PgDn' keys may be used even when the host is still
  5186. sending data. If Xon/Xoff flow control is in effect, no data will be lost.
  5187.  
  5188. The following VT102 features are not implemented:
  5189.  
  5190.    - Smooth scrolling
  5191.  
  5192.    - 132-column mode
  5193.  
  5194.    - Alternate character ROM
  5195.  
  5196.    - LED lamps
  5197.  
  5198. The VT102 keyboard autorepeat mode is always enabled.
  5199.  
  5200. When in connect mode, typing the escape character (Control-]) followed by a ?
  5201. for help will display a "pop-up" help window, indicating the options available.
  5202. If ^]c is typed to close the connection, the screen is restored to its state
  5203. when the 'connect' command was issued.  A subsequent 'connect' will re-display
  5204. the VT102 screen.
  5205.  
  5206. The control codes and escape sequences recognised by the VT102 emulation are
  5207. listed below.  For full details of the effects of these codes, please consult
  5208. the VT102 manual.
  5209.  
  5210. ENQ           5     Send answerback message "OS/2 Kermit"
  5211. BEL           7     Sound beep
  5212. BS            8     Cursor left
  5213. TAB           9     Cursor to next tab stop
  5214. LF            10    Cursor down
  5215. VT            11    As LF
  5216. FF            12    As LF
  5217. CR            13    Cursor to left margin
  5218. SO            14    Select G1 character set
  5219. SI            15    Select G0 character set
  5220. CAN           24    Cancel escape sequence
  5221. SUB           26    As CAN
  5222. ESC           26    See below
  5223. Others              Ignored
  5224.  
  5225. ESC 7         Save cursor position
  5226. ESC 8         Restore cursor position
  5227. ESC D         Index
  5228. ESC E         Next line
  5229. ESC H         Set tab at current column
  5230. ESC M         Reverse index
  5231. ESC Z         Identify terminal
  5232. ESC c         Reset
  5233. ESC =         Enter application keypad mode
  5234. ESC >         Exit application keypad mode
  5235. ESC # 3       Double height and width emulation, top half line
  5236. ESC # 4       Double height and width emulation, bottom half line
  5237. ESC # 5       Single height and width
  5238. ESC # 6       Single height and double width emulation
  5239. ESC # 8       Screen alignment display
  5240. ESC ( g             G0 designator - g = A,B or 0 only
  5241. ESC ) g             G1 designator - g = A,B or 0 only
  5242. ESC [ Pn A          Cursor up
  5243. ESC [ Pn B          Cursor down
  5244. ESC [ Pn C          Cursor right
  5245. ESC [ Pn D          Cursor left
  5246. ESC [ Pl ;Pc H      Direct cursor address
  5247. ESC [ Pl ;Pc f      Direct cursor address
  5248. ESC [ Pn c          Identify report - response is ESC [ ? 6 ; 2 c
  5249. ESC [ 3 g           Clear all tabs
  5250. ESC [ 0 g           Clear tabs at current column
  5251. ESC [ ? Pn h        Set DEC private mode, shown below
  5252. ESC [ ? Pn l        Reset DEC private mode, shown below
  5253.  
  5254.     mode no.        mode            set           reset
  5255.  
  5256.         1           Cursor key      Application   Cursor
  5257.         2           ANSI/VT52       N/A           VT52
  5258.         5           Screen          Reverse       Normal
  5259.         6           Origin          Relative      Absolute
  5260.         7           Wraparound      On            Off
  5261.  
  5262. ESC [ Pn h          Set mode - modes supported as shown below
  5263. ESC [ Pn l          Reset mode - modes supported as shown below
  5264.  
  5265.     mode no.        mode            set           reset
  5266.  
  5267.         2           Keyboard lock   On            Off
  5268.         4           Insert          Insert        Replace
  5269.        20           Newline         CR LF         CR
  5270. ESC Pn i            Printer/screen on/off - 4 to 7 supported
  5271. ESC [ 5 n           Status report
  5272. ESC [ 6 n           Cursor position report
  5273. ESC [ Pn x          Request terminal parameter
  5274. ESC [ Pn ;Pn r      Set top and bottom margins
  5275. ESC [ 0 J           Erase to end of screen
  5276. ESC [ 1 J           Erase from beginning of screen
  5277. ESC [ 2 J           Erase all of screen
  5278. ESC [ 0 K           Erase to end of line
  5279. ESC [ 1 K           Erase from beginning of line
  5280. ESC [ 2 K           Erase all of line
  5281. ESC [ Pn L          Insert blank lines
  5282. ESC [ Pn M          Delete lines
  5283. ESC [ Pn @          Insert blank characters
  5284. ESC [ Pn P          Delete characters
  5285. ESC [ Ps ;Ps ; ..;Ps m    Character attributes or
  5286. ESC [ Ps ;Ps ; ..;Ps }    Character attributes, as below:
  5287. 0       Default settings
  5288. 1       High intensity
  5289. 4       Underline
  5290. 5       Blink
  5291. 7       Reverse
  5292. 8       Invisible
  5293. 30-37   sets foreground colour to be as shown
  5294.         30      black
  5295.         31      red
  5296.         32      green
  5297.         33      yellow
  5298.         34      blue
  5299.         35      magenta
  5300.         36      cyan
  5301.         37      white
  5302. 40-47   sets background colour to be as shown
  5303.         40      black
  5304.         41      red
  5305.         42      green
  5306.         43      yellow
  5307.         44      blue
  5308.         45      magenta
  5309.         46      cyan
  5310.         47      white
  5311.  
  5312. Note that the default character set for both G0 and G1 is 'A', ie the UK
  5313. character set.
  5314.  
  5315. The following escape sequences are recognised when the emulator is put into
  5316. VT52 mode by receiving the sequence ESC [ ? 2 l.
  5317.  
  5318. ESC A         Cursor up
  5319. ESC B         Cursor down
  5320. ESC C         Cursor right
  5321. ESC D         Cursor leftup
  5322. ESC F         Enter graphics mode
  5323. ESC G         Exit graphics mode
  5324. ESC H         Cursor to home
  5325. ESC I         Reverse line feed
  5326. ESC J         Erase to end of screen
  5327. ESC K         Erase to end of line
  5328. ESC Y l c     Direct cursor address
  5329. ESC Z         Identify
  5330. ESC =         Enter application keypad mode
  5331. ESC >         Exit application keypad mode
  5332. ESC <         Enter ANSI mode
  5333.  
  5334. The escape sequences below are accepted but ignored.
  5335.  
  5336.     ESC O x       where x is any character
  5337.     ESC ? x       where x is any character
  5338.     ESC [ Pn q    Load LEDs
  5339.  
  5340.  
  5341. 1.19.6. Keyboard mapping
  5342.  
  5343. The OS/2 version of C-Kermit provides the same keyboard mapping as the UNIX
  5344. version. A particular key can be mapped to itself (default for all keys), to
  5345. another key (single key stroke) or to a sequence of key strokes (a macro text).
  5346. Use the SET KEY command for this purpose.
  5347.  
  5348. An extension was made to the standard SET KEY command to allow mapping of the
  5349. additional PC keyboard keys. Unlike the UNIX version, the OS/2 version knows of
  5350. 768 rather than only 256 keys. The keys 0..255 are the usual ASCII and extended
  5351. ASCII (8-bit PC-specific) characters while all extended keys (such as cursor
  5352. and function keys) in various combinations with SHIFT, CONTROL and ALT are
  5353. known as 256..767 to C-Kermit. To find out what the number of some key is,
  5354. enter the SHOW KEY command and press that key. The SHOW KEY command will then
  5355. report the key number and the current assignment.
  5356.  
  5357. Note that a few extended keys have a special meaning to the VT-102 emulator in
  5358. CONNECT mode. The cursor keys, for example, send the VT-102 cursor key escape
  5359. sequences while Page-Up and Page-Down are used to control the emulator's
  5360. scrollback buffer.
  5361.  
  5362. That means, the CONNECT mode knows a few key numbers and treats them specially.
  5363. If you map another key to the code of one of this special known keys, that
  5364. other key will also function like this special key.
  5365.  
  5366.  
  5367. 1.19.7. OS/2 C-Kermit Restrictions and Known Bugs
  5368.  
  5369.    1. Server breakout:  There is no way of stopping server operation from
  5370.       the keyboard, short of Control-C.
  5371.  
  5372.    2. Debugging log:  There is very little debugging information logged
  5373.       from the OS/2-specific parts of the program (it was developed using
  5374.       Codeview).
  5375.  
  5376.    3. Terminal emulation:  If the host sends the escape sequence to put
  5377.       the terminal into 132-column mode, and subsequently sends data which
  5378.       would appear in the rightmost 52 columns, this may mess up the
  5379.       existing data on the screen.  Really the emulator should ignore any
  5380.       data for these columns.
  5381.  
  5382.    4. File type:  The way Control-Z is handled could be better.  We need a
  5383.       'set ctrlz {on, off}' like MS-DOS Kermit.
  5384.  
  5385.    5. A better display of progress of a transfer is needed.
  5386.  
  5387.  
  5388. 1.19.8. Invoking OS/2 C-Kermit from Another Program
  5389.  
  5390. If you are writing a communications program and wish to incorporate the Kermit
  5391. protocol within it, one way is to use the OS/2 function call DosExecPgm to call
  5392. up C-Kermit.  You would supply the instructions for Kermit using command-line
  5393. options, and Kermit would do the transfer, returning back to your program when
  5394. it had finished.
  5395.  
  5396. The only problem with this scenario is that you might already have opened up
  5397. the COM port within your program, so that when Kermit tries to do the same it
  5398. gets an error code back from DosOpen.  The -u command line option gets round
  5399. this problem.  It uses the fact that a child process inherits the open file
  5400. handles of its parent.  -u takes one numeric parameter which is the handle of
  5401. the COM port in question, and it must occur in front of any other command-line
  5402. parameter which accesses the COM port.  The following is a complete C program
  5403. written using the Microsoft C compiler version 5.1 and the Microsoft OS/2
  5404. Software Development Toolkit, which illustrates how to use the -u command-line
  5405. option (NOTE: the UNIX version uses -l for this).
  5406. #define INCL_BASE
  5407. #include <os2.h>
  5408. /*
  5409.  *      Example of how to use the C-Kermit -u option to invoke
  5410.  *      Kermit from another program under OS/2.
  5411.  */
  5412. main(int argc, char *argv[]) {
  5413. HFILE   ttyfd;
  5414. USHORT  action;
  5415. int     err,i;
  5416. char    failname[80];
  5417. char    args[80];
  5418. RESULTCODES     res;
  5419. struct dcb {                    /* Device control block */
  5420.         USHORT write_timeout;
  5421.         USHORT read_timeout;
  5422.         BYTE flags1, flags2, flags3;
  5423.         BYTE error_replacement;
  5424.         BYTE break_replacement;
  5425.         BYTE xon_char;
  5426.         BYTE xoff_char;
  5427. } ttydcb;
  5428.  
  5429.         /*** Open a file ***/
  5430.         if (err=DosOpen(argv[1],&ttyfd,&action,0L,0,1,0x0012,0L)) {
  5431.                 printf("Error %d opening %s\n",err,argv[1]);
  5432.                 exit(1);
  5433.         }
  5434.         if (err=DosDevIOCtl(&ttydcb,NULL,0x0073,1,ttyfd)) {
  5435.                 printf("Error %d from IOCTL on %s\n",err,argv[1]);
  5436.                 exit(1);
  5437.         }
  5438.         ttydcb.flags3 &= 0xF9;
  5439.         ttydcb.flags3 |= 0x04;  /* Read "some" data from line */
  5440.         DosDevIOCtl(NULL,&ttydcb,0x0053,1,ttyfd);
  5441.  
  5442.         /*** Call kermit ***/
  5443.         strcpy(args,"ckoker");
  5444.         i = strlen(args);
  5445.         args[i++]=0;
  5446.         sprintf(&args[i],"-u %d -q -s test.c",ttyfd);
  5447.         i += strlen(&args[i]);
  5448.         args[i++]=0;
  5449.         args[i++]=0;
  5450.         if (err=DosExecPgm(failname,80,EXEC_SYNC,args,NULL,&res,
  5451.                                                     "KERMIT.EXE")) {
  5452.                 printf("Error %d executing Kermit\n",err);
  5453.                 exit(1);
  5454.         }
  5455.  
  5456.         /*** Print out return code ***/
  5457.         printf("Termination code %d\n",res.codeTerminate);
  5458.         printf("Result code %d\n",res.codeResult);
  5459.  
  5460.         /*** Close the file ***/
  5461.         if (err=DosClose(ttyfd)) {
  5462.                 printf("Error %d closing %s\n",err,argv[1]);
  5463.         }
  5464. }
  5465. 1.20. C-Kermit on the Commodore Amiga
  5466.  
  5467. This section written mostly by Jack Rouse and Stephen Walton.
  5468.  
  5469. This version of Amiga Kermit is a port of the UNIX C-Kermit which attempts to
  5470. reproduce as much of the functionality of UNIX version as possible.  I had two
  5471. main goals in porting C-Kermit:  I wanted a reliable remote file transfer
  5472. utility, and I wanted to investigate the use of the AmigaDOS and Exec
  5473. environments.
  5474.  
  5475. Amiga Kermit currently provides a line oriented user interface.  The DIAL and
  5476. SCRIPT commands are as yet unimplemented.  Therefore, only Amiga specific
  5477. features are noted below.
  5478.  
  5479.  
  5480. 1.20.1. Invoking C-Kermit
  5481.  
  5482. Amiga Kermit is usually invoked from a CLI process.  However, you can also
  5483. start it from a Tool type icon, at least for the version of Kermit compiled
  5484. with Manx Aztec C. Create a Tool icon, called Kermit.info, and make sure that
  5485. it contains a ToolType entry for WINDOW= followed by some window specification.
  5486. This is actually a small dummy window, as C Kermit will open and use its own
  5487. window.
  5488.  
  5489. From a CLI window, you generally enter:
  5490.  
  5491.     KERMIT
  5492.  
  5493. or
  5494.  
  5495.     RUN KERMIT
  5496.  
  5497. to execute Kermit and start up the Kermit command interpreter.  Make sure you
  5498. set your stack to at least 10000 with the AmigaDOS Stack command first.  Kermit
  5499. will create its own window and greet you with:
  5500.  
  5501.        C-Kermit S/W, 5A(180) BETA 8 Feb 92, Commodore Amiga
  5502.        Type ? or 'help' for help
  5503.        C-Kermit>
  5504.  
  5505. The cursor will appear following the C-Kermit> prompt.  Typing ? will produce a
  5506. list of the items that can be entered at any point.
  5507.  
  5508. Typing ? at various points during command entry will help you navigate through
  5509. the command processor.  The 'help' command is also quite useful.
  5510.  
  5511. The Kermit command processor is normally exited with the 'QUIT' command.
  5512. During Kermit protocol, you can type CTRL-C or CTRL-D to interrupt and exit
  5513. Kermit.  Depending on the version of the C runtime libraries used to link
  5514. Kermit, the interrupt may also be active during command input, but it is
  5515. disabled during connect mode.  You will get a requestor when the interrupt is
  5516. activated to allow you to choose to continue Kermit.  However, any serial read
  5517. or write that was interrupted will still be aborted.
  5518.  
  5519. Kermit can also be used without the command processor by specifying an action
  5520. on the command line.  You can enter 'kermit -h' at the CLI prompt to get a list
  5521. of command line options.  However, unless input is redirected, or the -q
  5522. (quiet) option is specified, Kermit will still create a window for protocol
  5523. monitoring and interruption.  'KERMIT <*' can be used to run Kermit completely
  5524. within the CLI window; however, this does not allow you to enter control
  5525. characters, and no console input is seen until you enter return.  Input and
  5526. output can be redirected to files to take advantage of C-Kermit command line
  5527. file transfer options.  Unfortunately, AmigaDOS does not implement pipes (yet).
  5528.  
  5529.  
  5530. 1.20.2. Kermit Serial Initialization and Settings
  5531.  
  5532. Amiga Kermit uses the serial device or a reasonable emulation thereof.  Three
  5533. sources are used to initialize the serial parameters.  First, the default
  5534. serial configuration, as set by Preferences, is copied.  This includes baud
  5535. rate, and under version 1.2 of the Workbench, parity, modem control (7-wire vs.
  5536. 3-wire), and flow control.  Second, command line parameters can be used to
  5537. override these settings.  For example:
  5538.  
  5539.     kermit -b 1200 -p e
  5540.  
  5541. can be used to select 1200 baud and even parity independently of the
  5542. Preferences settings.  Finally, if the command processor is used, Kermit looks
  5543. for a .kermrc initialization file, first in the s: directory, then in the
  5544. current directory, providing that the disk containing each directory is present
  5545. in the Amiga.  The .kermrc file contains C-Kermit commands which can be used to
  5546. initialize the C-Kermit environment as desired.
  5547.  
  5548. The Kermit SET LINE command has a special form in Amiga Kermit, namely:
  5549.  
  5550.     SET LINE device/unit
  5551.  
  5552. where device is the name of a device (including the .device extension) and unit
  5553. is the unit number.  The default setting is equivalent to:
  5554.  
  5555.     SET LINE serial.device/0
  5556.  
  5557. The modem control mode is currently selected by 'SET MODEM type', which has two
  5558. choices: 'DIRECT', for 3-wire control, and 'GENERIC', for 7-wire control.
  5559. Because of the way the serial device operates, this setting only has an effect
  5560. when the serial device is opened after previously being closed, which occurs
  5561. only when the serial line is used after Kermit starts or after '<escape>H' is
  5562. used to hang up and exit connect mode.
  5563.  
  5564. Kermit allows you to set any baud rate between 110 and 292000 baud; however, it
  5565. will complain if the baud rate is nonstandard.  Rates of 110 and 111 baud are
  5566. implemented as 112 baud.  Rates above 38400 baud can be used for connect mode,
  5567. but they are not very useful for file transfer.  The file transfer rate is
  5568. limited by packet retries due to transfer errors, and the overhead time spent
  5569. constructing packets.
  5570.  
  5571. Amiga Kermit uses the serial device in shared mode.  This allows other
  5572. programs, like dialers, to use the serial line at the same time, without
  5573. exiting Kermit.  This could also allow in theory a terminal emulator to be used
  5574. simultaneously with Kermit.  However, if two programs are reading from the
  5575. serial line at the same time, the results are unpredictable.  Any such program,
  5576. therefore, would have to be disabled from reading while Kermit is performing
  5577. file transfer or is in connect mode.  Note that Kermit since does its own
  5578. parity generation and stripping, so it always sets the serial device to use
  5579. eight bit characters with no parity.
  5580.  
  5581.  
  5582. 1.20.3. Amiga Wildcards
  5583.  
  5584. Both the SEND command invoked from the Amiga and a GET sent to an Amiga in
  5585. server mode use allow wildcarding, in the UNIX style.  Thus, '*' wildcard
  5586. matches an arbitrary string while '?' matches an arbitrary character.
  5587. Therefore, to get all the C source files which begin with 'cki' from the Amiga
  5588. server, you could use the command:
  5589.  
  5590.        C-Kermit>get cki*.c
  5591.  
  5592. Multiple '*' wildcards can be used in a pattern.  Remember, the wildcarding
  5593. that is used in local and remote server commands that invoke AmigaDOS commands
  5594. is the AmigaDOS form.
  5595.  
  5596.  
  5597. 1.20.4. Local and Remote Commands
  5598.  
  5599. Amiga Kermit provides several ways to invoke AmigaDOS commands from within
  5600. Kermit.  Entering '!' at the Kermit prompt will create a CLI process running in
  5601. its own window, and wait for it to terminate.  The form '! command' will invoke
  5602. the given command command with its output going to Kermit's window.  There is
  5603. currently no way to pause the output of commands invoked his way, other than
  5604. the stopgap use of the right mouse button.  The form 'REMOTE HOST command' can
  5605. be sent to the Amiga server to execute the given command remotely on the Amiga.
  5606. Because of the way AmigaDOS Execute() function works, commands invoked in
  5607. either the '! command' or 'REMOTE HOST command' forms have NIL: as their
  5608. standard input.  Some AmigaDOS commands that require input, such as DiskCopy
  5609. and Format, do not recognize the immediate end of file that they receive under
  5610. this condition, causing them to hang.
  5611.  
  5612. In addition to the methods given above, various AmigaDOS commands are invoked
  5613. by local Kermit commands, and generic remote commands.  These are listed below:
  5614.  
  5615. AmigaDOS command    Local command      Remote generic command
  5616. DELETE files        --none--           REMOTE DELETE files
  5617. TYPE files          --none--           REMOTE TYPE files
  5618. INFO                SPACE              REMOTE SPACE
  5619. LIST obj            DIRECTORY obj      REMOTE DIRECTORY
  5620. STATUS              --none--           REMOTE WHO
  5621.  
  5622. Any parameters to these commands are expected to use AmigaDOS conventions,
  5623. including AmigaDOS wildcarding.  Note that in order to pass a '?' through the
  5624. C-Kermit command processor, it must be prefixed with a '\'.
  5625.  
  5626. You can change the current directory of the Kermit process locally with the CWD
  5627. command and remotely with REMOTE CWD.  The local CWD command prints out the
  5628. name of the current directory afterwards.  If no new directory is given, the
  5629. current directory is not changed, so CWD alone can be used to determine where
  5630. the current directory is.
  5631.  
  5632.  
  5633. 1.20.5. Server Mode
  5634.  
  5635. Amiga Kermit completely implements server mode, including the ability to
  5636. execute CLI commands remotely.  Currently CLI commands are executed with their
  5637. standard output directed to RAM:PIPE-HOLDER, which is then written back to the
  5638. commanding Kermit after the command completes.
  5639.  
  5640. There are a few limitations on the commands that can be executed remotely.
  5641. First of all, if they produce voluminous output, the output should be
  5642. redirected (redirection is supported on the REMOTE HOST command line) to avoid
  5643. using all free memory for the output file.  However, the commanding Kermit will
  5644. probably timeout in the middle of the execution of any such command.  The best
  5645. way to use these commands is to
  5646.  
  5647.        REMOTE HOST RUN command >outfile parameters
  5648.  
  5649. then use REMOTE WHO (which invokes STATUS) to monitor the command for
  5650. completion.
  5651.  
  5652. The input stream for remote commands is NIL:, which is not handled
  5653. intelligently by all Amiga commands.  For example, 'REMOTE HOST diskcopy df0:
  5654. to df1:' hangs indefinitely while waiting for NIL: to press return.  Finally,
  5655. since each command is executed in a separate CLI, commands that set unshared
  5656. process parameters, like 'cd', will have null effect (but 'REMOTE CWD dir' can
  5657. be used instead).
  5658.  
  5659. While server mode is active, AmigaDOS requestors are disabled.  This avoids
  5660. requiring operator intervention to reset a requestore when the Amiga server is
  5661. told to use a file on a disk that does not exist or is write protected.
  5662. However, disabled requestors are currently not inherited by the CLI processes
  5663. that the server creates to execute remote commands.  Therefore, a remote
  5664. AmigaDOS command can still cause the server to become hung.
  5665.  
  5666. To shut down the Amiga server, enter BYE or FINISH at the commanding Kermit.
  5667. FINISH exits to whatever level the server was invoked from, while BYE exits
  5668. Amiga Kermit altogether.
  5669.  
  5670.  
  5671. 1.20.6. Connect Mode
  5672.  
  5673. Connect mode on Amiga Kermit currently provides you with a standard AmigaDOS
  5674. console device window.  Using the default Preferences setting, this gives a 23
  5675. row by 77 column screen.  However, the MoreRows program allows you to increase
  5676. the size of the Workbench window beyond the 640 by 200 default size; increasing
  5677. the number of rows by 8 and the number of columns by 16 will allow a 24 row by
  5678. 80 column Kermit window.  The Amiga console device is used to provide ANSI
  5679. terminal emulation.  While you are in connect mode, you can give single
  5680. character commands which are prefixed by an escape character which can be set
  5681. from within C-Kermit.  By default, the escape character is CTRL-\.  You can use
  5682. '<escape>H' to close the serial device and exit connect mode, which makes the
  5683. DTR line drop causing most modems to hang up the phone line.
  5684.  
  5685. You can currently get a 25 by 80 screen in Kermit by means of a kludge.
  5686. Entering the Kermit command line (backslashes will be echoed only once):
  5687.  
  5688.     ECHO \\033[25t\\033[80u\\033[0x\\033[0y\\014
  5689.  
  5690. activates console device private escape sequences that cause the console to use
  5691. a 25 by 80 region, overwriting the borders of the Kermit window.  Using window
  5692. gadgets will cause the borders to be redisplayed, but the display can be
  5693. cleaned up by typing ctrl-L in command mode.  To reset the window to its normal
  5694. condition, allowing resizing, use:
  5695.  
  5696.     ECHO \\033[t\\033[u\\033[x\\033[y\\014
  5697.  
  5698. and then activate a window gadget to refresh the borders.  These commands can
  5699. be placed into Kermit TAKE files.
  5700.  
  5701. In addition to the standard connect mode commands, extra logging control has
  5702. been added.  If a session log file is open, the '<escape>Q' sequence allows you
  5703. to temporarily suspend logging.  The '<escape>R' sequence resumes logging if it
  5704. has been suspended.
  5705.  
  5706. Features have also been added to prevent deadlocks while in connect mode due to
  5707. spurious XOFF's or bad modem control line states.  When connect mode is unable
  5708. to send serial output, keyboard characters are queued until they can be
  5709. transmitted.  Queuing continues as long as space is available in the output
  5710. buffer.  If the buffer, which is 64 characters long, fills up, the next
  5711. keyboard input is discarded and the display 'beeps'.  To get out of a deadlock
  5712. situation, you can either exit connect mode, or send a break.  In either case,
  5713. the output queue is flushed, and current serial output character is given one
  5714. second to finish transmitting.  If it does not complete, the output is aborted,
  5715. and XOFF mode reset as appropriate.  Then connect mode is exited or a break is
  5716. sent, as specified.  When output characters are queued, connect status
  5717. (accessed by '<escape>S') will indicate the number of queued output characters.
  5718.  
  5719.  
  5720. 1.21. C-Kermit under OS-9
  5721.  
  5722. C-Kermit was adapted to OS-9 by Christian Hemsing, RWTH, Aachen, Germany, and
  5723. Bob Larson of the University of Southern California.  This section of the
  5724. manual was written by Christian Hemsing.
  5725.  
  5726. The commands and operation of OS-9 C-Kermit should be identical to those of
  5727. UNIX C-Kermit, with the exceptions noted here and in the "beware file".
  5728.  
  5729. The initialization file is .kermrc.
  5730.  
  5731.  
  5732. 1.21.1. OS-9/68K Background
  5733.  
  5734. OS-9/68k is a multiuser, multitasking operating system designed to run on all
  5735. Motorola 680x0 family processors from Microware Systems Corporation, 1900 N.W.
  5736. 114th Street, Des Moines, Iowa 50332 (Trademarks: Microware, OS-9, OS-9/68000,
  5737. OS-9000).
  5738.  
  5739. Due to its modular design, most of the code is completely hardware independent,
  5740. so it can be easily be ported to a different hardware by writing new device
  5741. drivers.
  5742.  
  5743. The original (1980) OS-9/6809 was designed for the Motorola 6809 processor.
  5744. Later (1983) they switched to the 680x0 family and released OS-9/68000.  For
  5745. speed and compactness reasons most of the OS-9/68000 kernel is written in 680x0
  5746. assembler language.  Now there is a so-called OS-9000 by Microware.  Its kernel
  5747. is written in C and thus it is portable.  It is presently available for 680x0
  5748. and Intel's 80386/486, and Microware plans to add further support for RISC and
  5749. CISC processors.  (C-Kermit has not yet been tested under OS-9000.)
  5750.  
  5751. The 100% ROM-able, fast, compact code in conjunction with real-time
  5752. capabilities make OS-9/68k ideal for ROM-based systems used in measuring,
  5753. controlling, etc.  It has found a wide acceptance within the scientific and
  5754. industrial world.
  5755.  
  5756. Yet, a full disk based OS-9/68k offers a program development environment
  5757. similar to UNIX. This includes (of course, limited) UNIX sofware compatibility
  5758. at C source code level, source code level debugging, UNIX I/O model, UNIX task
  5759. model, UNIX-like shell and networking.
  5760.  
  5761. A number of UNIX utilities like lex, yacc, lint, etc, have been ported to
  5762. OS-9/68k.
  5763.  
  5764. The basic commands of OS-9 are:
  5765.  
  5766. DEL             delete a file
  5767. DELDIR          delete a directory
  5768. MAKDIR          create a directory
  5769. DIR             directory listing
  5770. PROCS           show currently running processes
  5771. LIST            type contents of a text file
  5772. CHD             change working directory
  5773. PD              print working directory
  5774.  
  5775. All commands can be given a "-?" as a switch, which will display a brief
  5776. (usually sufficient) help message.
  5777.  
  5778. All command references (like all references to names on OS-9/68k) are NOT case
  5779. sensitive (switches, though, may be case sensitive since they are interpreted
  5780. by the running program).
  5781.  
  5782.  
  5783. 1.21.2. OS-9/68K Devices
  5784.  
  5785. All devices (terminal lines, networks, disks) can have arbitrary names but the
  5786. usual convention is:
  5787.  
  5788. Terminal lines:
  5789.    term   the console terminal
  5790.    t1     terminal line #1
  5791.    :
  5792.    tn     terminal line #n
  5793.  
  5794. Hard disks:
  5795.    h0     hard disk #0
  5796.    h1     hard disk #1
  5797.    :
  5798.    hn     harddisk #n
  5799.  
  5800. Floppy disks (diskettes):
  5801.    d0     floppy disk drive #0
  5802.    d1     floppy disk drive #1
  5803.    :
  5804.    dn     floppy disk drive #n
  5805.  
  5806. A path name starting with a slash ("/") must always include a device name as
  5807. the first field.  For example, the C-Kermit command SET LINE /T3 would select
  5808. the terminal line /t3.
  5809.  
  5810. The console terminal is either a real terminal, or the screen and keyboard of a
  5811. workstation such as a Macintosh, Amiga, or Atari ST that is running OS-9.
  5812. Terminal emulation is not done by OS-9 C-Kermit, but rather by the real
  5813. terminal or the workstation console driver.  This includes the capability to
  5814. display national and international characters.
  5815.  
  5816.  
  5817. 1.21.3. The OS-9/68K File System
  5818.  
  5819. The file system is tree-structured just like the UNIX file system.
  5820.  
  5821.     /h0/chris
  5822.  
  5823. means the directory or file "chris" on hard disk #0.
  5824.  
  5825.     chris/rubbish
  5826.  
  5827. means the subdirectory or file "rubbish" in the subdirectory "chris" of the
  5828. current directory.
  5829.  
  5830. The command "chd" without any parameters will always take you to your home
  5831. directory.
  5832.  
  5833. Names of files, directories, devices, and commands are case-independent.
  5834. Filenames may contain letters, digits, period, underline, and dollar sign.
  5835. They are stored with upper and lower case preserved, but case is not
  5836. significant when referring to them.
  5837.  
  5838. Wildcard expansion is performed by the shell with two metacharacters:
  5839.  
  5840.   * stands for an arbitrary string of arbitrary length ?
  5841.     denotes a single character
  5842.  
  5843. C-Kermit/OS-9 also expands wildcards itself, using the same notation, for
  5844. example:
  5845.  
  5846.     C-Kermit>send ck*.\?
  5847.  
  5848. (Note: the question mark must be prefixed by "\" to override its normal
  5849. function of giving a help message.)
  5850.  
  5851. OS-9/68k files are sequential streams of 8-bit bytes, just like in UNIX, except
  5852. that carriage return (CR, ASCII 13) is the line terminator, rather than
  5853. linefeed (LF, ASCII 10).  Binary files are simply streams of arbitrary 8-bit
  5854. bytes.  The OS-9 operating system and utilities are "8-bit clean", so text
  5855. files can use any ASCII-based character set that is compatible with your
  5856. display and data entry devices, for example ISO 8859-1 Latin Alphabet 1.
  5857.  
  5858. Unlike UNIX, OS-9/68k has a built-in method to gain exclusive access to
  5859. devices, so no lock files are needed.  The user will be told if the device is
  5860. already in use.
  5861. 1.21.4. To Build C-Kermit for OS-9
  5862.  
  5863. Collect all the C-Kermit source files into a directory:
  5864.  
  5865.     ckc*.c, ckc*.h, cku*.c, cku*.h, ckwart.c, ckcpro.w, ck9*.*
  5866.  
  5867. There are two makefiles: ck9ker.mak and ck9ker.gcc.  If you have a running
  5868. version of the GNU C compiler, use ck9ker.gcc (it produces smaller, more
  5869. efficient code); otherwise use ck9ker.mak which uses the standard OS-9/68k C
  5870. compiler.  Read the appropropriate makefile, edit the necessary changes
  5871. mentioned there, create the subdirectories, and make the new Kermit by typing:
  5872.  
  5873.     make -f=ck9ker.mak
  5874.  
  5875. or:
  5876.  
  5877.     make -f=ck9ker.gcc
  5878.  
  5879. Read the "beware file" ck9ker.bwr for hints relating to the OS-9 terminal
  5880. driver.
  5881.